Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>UPDATE:</strong></p> <p>After testing your code with non-existed paths, I have reproduced your error. Probably condition is evaluated after the task dll is challenged to load. </p> <p>You can modify your code to get rid of the error by first building the path (either using <code>$(VisualStudioVersion)</code> or by hand:</p> <pre><code>&lt;Project ToolsVersion="4.0" DefaultTargets="Echo" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt; &lt;PropertyGroup&gt; &lt;VSExtPath&gt;$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\&lt;/VSExtPath&gt; &lt;VSExtPath Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v11.0')"&gt;$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v11.0\&lt;/VSExtPath&gt; &lt;/PropertyGroup&gt; &lt;UsingTask TaskName="TransformXml" AssemblyFile="$(VSExtPath)\Web\Microsoft.Web.Publishing.Tasks.dll" /&gt; &lt;Target Name="Echo"&gt; &lt;Message Text="$(VSExtPath)" /&gt; &lt;TransformXml /&gt; &lt;/Target&gt; &lt;/Project&gt; </code></pre> <hr> <p>Another solution would be to use <code>$(VisualStudioVersion)</code> property in the same way ordinary <code>.csproj</code> files use it.</p> <p>You could use $(VisualStudioVersion) to import the appropriate version of the task: </p> <pre><code>&lt;PropertyGroup&gt; &lt;VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''"&gt;10.0&lt;/VisualStudioVersion&gt; &lt;/PropertyGroup&gt; &lt;UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.Tasks.dll" /&gt; </code></pre> <p>As of .net 4.5 the <code>$(VisualStudioVersion)</code> property is set by MSBuild (to the highest available). See details <a href="http://sedodream.com/2012/08/19/VisualStudioProjectCompatabilityAndVisualStudioVersion.aspx" rel="nofollow">Sayed Hasimy blog</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload