1

I have a old solution which worked fine with VS 2012 and now I migrate it to VS 2013.

When I try to build a configuration which involve web.config replacement i got this error:

Error 1 The "TransformXml" task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.Tasks.dll. Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.Tasks.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

What it mean is that there no build tools in my v11.0 which is right. Because I use Visual Studio 2013. (the build tool are in a folder called v12.0) One option is to just copy my build tool to the right place but im searching for a real solution.

I found in my .csproj file these config:

<PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>

But im not really understand why it then v11.0 could be. I have tried multiple things to change these like set VisualStudioVersion explicit but it changed nothing.

So my question: where the heck come these path from and where can I configure it?

Pero P.
  • 25,813
  • 9
  • 61
  • 85
Sir l33tname
  • 4,026
  • 6
  • 38
  • 49
  • You should specify VisualStudioVersion explicitly. See http://sedodream.com/2012/08/19/VisualStudioProjectCompatabilityAndVisualStudioVersion.aspx – Sayed Ibrahim Hashimi Mar 14 '14 at 22:57
  • and where should I set the version if I build it from Visual Studio? – Sir l33tname Mar 15 '14 at 08:39
  • possible duplicate of [TransformXml task web.publishing.tasks.dll error](http://stackoverflow.com/questions/20358747/transformxml-task-web-publishing-tasks-dll-error) – Jason Aug 25 '14 at 08:30
  • @SayedIbrahimHashimi slightly off topic, but has the determination of `VisualStudioVersion` changed with the msbuild 12.0 tools/tfvctemplate.12.xaml? It seems that building a 2013 `.sln` using the `tfvctemplate.12.xaml` template will set the `VisualStudioVersion` to `12.0` (i.e. not using the File Format Version - 1 algorithm). – Pero P. Sep 17 '14 at 19:02
  • @pero I'm not sure. I've asked the MSBuild/Team Build team to reply back. – Sayed Ibrahim Hashimi Sep 18 '14 at 20:14
  • @pero from Chris Patterson "We just run MSBuild 12.0 in that template. We don’t explicitly set the VisualStudioVersion." – Sayed Ibrahim Hashimi Sep 22 '14 at 18:15

1 Answers1

0

Since vs2012 MS tries to keep sln file untouched if there is no reason to upgrade it (to allow opening sln in the old VS). If you’ve upgrade from vs2012 to vs2013 there can be chance you are opening solution in vs2012 (it happen to me in many updated solutions).

Try to check beginning of the sln file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013

or:

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012

If you wish to change it by VS, open sln in vs2013 and then select solution root node in solution explorer and the File > Save .sln (Ctrl+S)

Palo Misik
  • 741
  • 3
  • 7