{"id":1185,"date":"2010-10-08T15:08:28","date_gmt":"2010-10-08T13:08:28","guid":{"rendered":"http:\/\/www.limilabs.com\/blog\/?p=1185"},"modified":"2010-10-08T15:08:28","modified_gmt":"2010-10-08T13:08:28","slug":"update-nuspec-version-from-msbuild","status":"publish","type":"post","link":"https:\/\/www.limilabs.com\/blog\/update-nuspec-version-from-msbuild","title":{"rendered":"Update NuSpec version from MsBuild"},"content":{"rendered":"<p>Here&#8217;s the sample script that updates NuGet version node in NuSpec file:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;target Name=&quot;UpdateNuspec&quot;&gt;\n    &lt;getAssemblyIdentity AssemblyFiles=&quot;$(ReleaseFolder)\/Redistributables\/YourAssembly.dll&quot;&gt;\n      &lt;output TaskParameter=&quot;Assemblies&quot; ItemName=&quot;YourAssemblyInfo&quot;\/&gt;\n    &lt;\/getAssemblyIdentity&gt;\n    &lt;xmlUpdate\n        Prefix=&quot;nu&quot;\n        Namespace=&quot;http:\/\/schemas.microsoft.com\/packaging\/2010\/07\/nuspec.xsd&quot;\n        XmlFileName=&quot;YourAssembly.nuspec&quot;\n        XPath=&quot;package\/nu:metadata\/nu:version&quot;\n        Value=&quot;%(YourAssemblyInfo.Version)&quot;\/&gt;\n&lt;\/target&gt;\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s the sample script that updates NuGet version node in NuSpec file: &lt;target Name=&quot;UpdateNuspec&quot;&gt; &lt;getAssemblyIdentity AssemblyFiles=&quot;$(ReleaseFolder)\/Redistributables\/YourAssembly.dll&quot;&gt; &lt;output TaskParameter=&quot;Assemblies&quot; ItemName=&quot;YourAssemblyInfo&quot;\/&gt; &lt;\/getAssemblyIdentity&gt; &lt;xmlUpdate Prefix=&quot;nu&quot; Namespace=&quot;http:\/\/schemas.microsoft.com\/packaging\/2010\/07\/nuspec.xsd&quot; XmlFileName=&quot;YourAssembly.nuspec&quot; XPath=&quot;package\/nu:metadata\/nu:version&quot; Value=&quot;%(YourAssemblyInfo.Version)&quot;\/&gt; &lt;\/target&gt;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[36,39],"class_list":["post-1185","post","type-post","status-publish","format-standard","hentry","category-news","tag-msbuild","tag-nuget"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/1185"}],"collection":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/comments?post=1185"}],"version-history":[{"count":0,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/1185\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/media?parent=1185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/categories?post=1185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/tags?post=1185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}