{"id":1131,"date":"2006-09-22T18:10:00","date_gmt":"2006-09-22T23:10:00","guid":{"rendered":"http:\/\/blogs.devhorizon.com\/reza\/?p=1131"},"modified":"2006-09-22T18:10:00","modified_gmt":"2006-09-22T23:10:00","slug":"vsnet-intellisense-for-build-files-in-nant","status":"publish","type":"post","link":"https:\/\/blogs.devhorizon.com\/reza\/2006\/09\/22\/vsnet-intellisense-for-build-files-in-nant\/","title":{"rendered":"VS.NET Intellisense for .build files in NAnt"},"content":{"rendered":"<p><P class=MsoNormal style=\"MARGIN: 0in 0in 0pt\">If you have ever worked with <A href=\"http:\/\/nant.sourceforge.net\/\">NAnt<\/A>&nbsp;, you probably know that there is an xsd for .build files that provides intellisense in VS.NET 2003. After you add a task dll ( In my case NAnt.SharePoint.Task.dll) or<SPAN style=\"mso-spacerun: yes\">&nbsp;<\/SPAN>install a newer version of NAnt , there are some manual steps required to make VS recognizes the new schema. Instead of the manual process, you can get NAnt itself to update\/generate its schema for the internal use of VS.NET 2003 by creating a build file and calling the command line as described below:<\/P><br \/>\n<P class=MsoNormal style=\"MARGIN: 0in 0in 0pt\">1) Create UpdateCreateSchema.build file with the following NAnt snippet and save the file in for example c:<br \/>\nantGen folder :<\/P><br \/>\n<P class=MsoNormal style=\"MARGIN: 0in 0in 0pt\"><?xml version=\"1.0\" encoding=\"utf-8\" ?><?xml:namespace prefix = o ns = \"urn:schemas-microsoft-com:office:office\" \/><o:p><\/o:p><\/P><br \/>\n<P class=MsoNormal style=\"MARGIN: 0in 0in 0pt\"><PROJECT default=\"genschema\" name=\" UpdateCreateSchema\"><o:p><\/o:p><\/P><br \/>\n<BLOCKQUOTE dir=ltr style=\"MARGIN-RIGHT: 0px\"><br \/>\n<P class=MsoNormal style=\"MARGIN: 0in 0in 0pt\"><SPAN style=\"mso-spacerun: yes\">&nbsp;<\/SPAN><SPAN style=\"mso-spacerun: yes\"><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: blue; mso-ansi-language: EN\"><?<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: maroon; mso-ansi-language: EN\">xml<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: fuchsia; mso-ansi-language: EN\"> <\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: red; mso-ansi-language: EN\">version<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: blue; mso-ansi-language: EN\">=&#8221;1.0&#8243;<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: fuchsia; mso-ansi-language: EN\"> <\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: red; mso-ansi-language: EN\">encoding<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: blue; mso-ansi-language: EN\">=&#8221;utf-8&#8243;<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: fuchsia; mso-ansi-language: EN\"> <\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: blue; mso-ansi-language: EN\">?&gt;<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; mso-ansi-language: EN\"> <BR><SPAN style=\"COLOR: blue\">&lt;<\/SPAN><SPAN style=\"COLOR: maroon\">project<\/SPAN><SPAN style=\"COLOR: fuchsia\"> <\/SPAN><SPAN style=\"COLOR: red\">name<\/SPAN><SPAN style=\"COLOR: blue\">=&#8221;<\/SPAN><\/SPAN><SPAN lang=EN> <\/SPAN>UpdateCreateSchema<SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: blue; mso-ansi-language: EN\">&#8220;<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: fuchsia; mso-ansi-language: EN\"> <\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: red; mso-ansi-language: EN\">default<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: blue; mso-ansi-language: EN\">=&#8221;genschema&#8221;&gt;<BR><SPAN style=\"mso-spacerun: yes\">&nbsp;&nbsp;&nbsp; <\/SPAN><!\u2014VS.NET destination <SPAN style=\"mso-spacerun: yes\">&nbsp;<\/SPAN>might be different in your installation&#8211;&gt;<\/SPAN><\/SPAN><\/P><br \/>\n<P class=MsoNormal style=\"MARGIN: 0in 0in 0pt\"><SPAN style=\"mso-spacerun: yes\"><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: blue; mso-ansi-language: EN\">&nbsp;&nbsp;&nbsp; &lt;<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: maroon; mso-ansi-language: EN\">property<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: fuchsia; mso-ansi-language: EN\"> <\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: red; mso-ansi-language: EN\">name<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: blue; mso-ansi-language: EN\">=&#8221;SchemaFile&#8221;<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: fuchsia; mso-ansi-language: EN\"> <\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: red; mso-ansi-language: EN\">value<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: blue; mso-ansi-language: EN\">=&#8221;C:Program FilesMicrosoft Visual Studio .NET 2003Common7PackagesschemasxmlNAnt.xsd&#8221;\/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: maroon; mso-ansi-language: EN\">target<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: fuchsia; mso-ansi-language: EN\"> <\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: red; mso-ansi-language: EN\">name<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: blue; mso-ansi-language: EN\">=&#8221;genschema&#8221;&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: maroon; mso-ansi-language: EN\">nantschema<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: fuchsia; mso-ansi-language: EN\"> <\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: red; mso-ansi-language: EN\">output<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: blue; mso-ansi-language: EN\">=&#8221;${SchemaFile}&#8221;<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: fuchsia; mso-ansi-language: EN\"> <\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: red; mso-ansi-language: EN\">target-ns<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: blue; mso-ansi-language: EN\">=&#8221;http:\/\/nant.sf.net\/schemas\/nant.xsd&#8221;\/&gt;<BR>&nbsp;&nbsp;&nbsp; <\/< SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: maroon; mso-ansi-language: EN\">target<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: blue; mso-ansi-language: EN\">&gt;<BR><\/< SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: maroon; mso-ansi-language: EN\">project<\/SPAN><SPAN lang=EN style=\"FONT-SIZE: 10pt; COLOR: blue; mso-ansi-language: EN\">&gt;<\/SPAN><\/SPAN><SPAN style=\"mso-spacerun: yes\">&nbsp;&nbsp;&nbsp; <\/SPAN><\/P><\/BLOCKQUOTE><br \/>\n<P class=MsoNormal style=\"MARGIN: 0in 0in 0pt\">2) Assuming Nant has been properly added to Path variable, open a command prompt and change directory to c:<br \/>\nantGen . Call the following command line:<o:p><\/o:p><\/P><br \/>\n<P class=MsoNormal style=\"MARGIN: 0in 0in 0pt\"><SPAN style=\"mso-spacerun: yes\"><\/SPAN><\/P><br \/>\n<BLOCKQUOTE dir=ltr style=\"MARGIN-RIGHT: 0px\"><br \/>\n<P class=MsoNormal style=\"MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in\"><SPAN style=\"mso-spacerun: yes\">&nbsp;<\/SPAN>nant file: UpdateCreateSchema.build<\/P><\/BLOCKQUOTE><br \/>\n<P class=MsoNormal style=\"MARGIN: 0in 0in 0pt\">3) Now that you have deployed the latest version of NAnt.xsd file to the C:Program FilesMicrosoft Visual Studio .NET 2003Common7Packagesschemasxml folder , you must go through all of your build files in your project and <\/P><br \/>\n<BLOCKQUOTE dir=ltr style=\"MARGIN-RIGHT: 0px\"><br \/>\n<P class=MsoNormal style=\"MARGIN: 0in 0in 0pt 0.5in\">a.Make VS.NET recognize your .build file as an XML file (If already done, skip this step then ):<o:p>&nbsp;<\/o:p><\/P><br \/>\n<P class=MsoNormal style=\"MARGIN: 0in 0in 0pt 0.5in\">In &#8220;Solution Explorer&#8221;, right-click a .build file and choose &#8220;Open With&#8221;. In the &#8220;Open With&#8221; dialog, select &#8220;HTML\/XML Editor&#8221; and click the &#8220;Set as Default&#8221; button. Enable intellisense for each .build file.<\/P><br \/>\n<P class=MsoNormal style=\"MARGIN: 0in 0in 0pt 0.5in\">b.When file is opened by the &#8220;HTML\/XML Editor&#8221; , in the properties window , set the targetSchema to the newly updated\/generated Nant.xsd<\/P><\/BLOCKQUOTE><br \/>\n<P class=MsoNormal style=\"MARGIN: 0in 0in 0pt\">4) Boom. You&#8217;ll get intellisense. Enjoy!<\/P><\/SPAN><\/SPAN><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have ever worked with NAnt&nbsp;, you probably know that there is an xsd for .build files that provides intellisense in VS.NET 2003. After you add a task dll ( In my case NAnt.SharePoint.Task.dll) or&nbsp;install a newer version of NAnt , there are some manual steps required to make VS recognizes the new schema. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-1131","post","type-post","status-publish","format-standard","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>VS.NET Intellisense for .build files in NAnt - Reza Alirezaei&#039;s Blog %<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blogs.devhorizon.com\/reza\/2006\/09\/22\/vsnet-intellisense-for-build-files-in-nant\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Reza Alirezaei\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2006\\\/09\\\/22\\\/vsnet-intellisense-for-build-files-in-nant\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2006\\\/09\\\/22\\\/vsnet-intellisense-for-build-files-in-nant\\\/\"},\"author\":{\"name\":\"Reza Alirezaei\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#\\\/schema\\\/person\\\/cdbb24d283697a65951cb4a14e474938\"},\"headline\":\"VS.NET Intellisense for .build files in NAnt\",\"datePublished\":\"2006-09-22T23:10:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2006\\\/09\\\/22\\\/vsnet-intellisense-for-build-files-in-nant\\\/\"},\"wordCount\":122,\"commentCount\":0,\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2006\\\/09\\\/22\\\/vsnet-intellisense-for-build-files-in-nant\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2006\\\/09\\\/22\\\/vsnet-intellisense-for-build-files-in-nant\\\/\",\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2006\\\/09\\\/22\\\/vsnet-intellisense-for-build-files-in-nant\\\/\",\"name\":\"VS.NET Intellisense for .build files in NAnt - Reza Alirezaei's Blog %\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#website\"},\"datePublished\":\"2006-09-22T23:10:00+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#\\\/schema\\\/person\\\/cdbb24d283697a65951cb4a14e474938\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2006\\\/09\\\/22\\\/vsnet-intellisense-for-build-files-in-nant\\\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#website\",\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/\",\"name\":\"Reza Alirezaei's Blog\",\"description\":\"Blogging from the field!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#\\\/schema\\\/person\\\/cdbb24d283697a65951cb4a14e474938\",\"name\":\"Reza Alirezaei\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g\",\"caption\":\"Reza Alirezaei\"},\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/author\\\/rezaa\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"VS.NET Intellisense for .build files in NAnt - Reza Alirezaei's Blog %","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blogs.devhorizon.com\/reza\/2006\/09\/22\/vsnet-intellisense-for-build-files-in-nant\/","twitter_misc":{"Written by":"Reza Alirezaei","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blogs.devhorizon.com\/reza\/2006\/09\/22\/vsnet-intellisense-for-build-files-in-nant\/#article","isPartOf":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/2006\/09\/22\/vsnet-intellisense-for-build-files-in-nant\/"},"author":{"name":"Reza Alirezaei","@id":"https:\/\/blogs.devhorizon.com\/reza\/#\/schema\/person\/cdbb24d283697a65951cb4a14e474938"},"headline":"VS.NET Intellisense for .build files in NAnt","datePublished":"2006-09-22T23:10:00+00:00","mainEntityOfPage":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/2006\/09\/22\/vsnet-intellisense-for-build-files-in-nant\/"},"wordCount":122,"commentCount":0,"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blogs.devhorizon.com\/reza\/2006\/09\/22\/vsnet-intellisense-for-build-files-in-nant\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blogs.devhorizon.com\/reza\/2006\/09\/22\/vsnet-intellisense-for-build-files-in-nant\/","url":"https:\/\/blogs.devhorizon.com\/reza\/2006\/09\/22\/vsnet-intellisense-for-build-files-in-nant\/","name":"VS.NET Intellisense for .build files in NAnt - Reza Alirezaei's Blog %","isPartOf":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/#website"},"datePublished":"2006-09-22T23:10:00+00:00","author":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/#\/schema\/person\/cdbb24d283697a65951cb4a14e474938"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blogs.devhorizon.com\/reza\/2006\/09\/22\/vsnet-intellisense-for-build-files-in-nant\/"]}]},{"@type":"WebSite","@id":"https:\/\/blogs.devhorizon.com\/reza\/#website","url":"https:\/\/blogs.devhorizon.com\/reza\/","name":"Reza Alirezaei's Blog","description":"Blogging from the field!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blogs.devhorizon.com\/reza\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blogs.devhorizon.com\/reza\/#\/schema\/person\/cdbb24d283697a65951cb4a14e474938","name":"Reza Alirezaei","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g","caption":"Reza Alirezaei"},"url":"https:\/\/blogs.devhorizon.com\/reza\/author\/rezaa\/"}]}},"_links":{"self":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts\/1131","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/comments?post=1131"}],"version-history":[{"count":0,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts\/1131\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/media?parent=1131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/categories?post=1131"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/tags?post=1131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}