1
votes

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?

1
You should specify VisualStudioVersion explicitly. See sedodream.com/2012/08/19/…Sayed Ibrahim Hashimi
and where should I set the version if I build it from Visual Studio?Sir l33tname
@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.
@pero I'm not sure. I've asked the MSBuild/Team Build team to reply back.Sayed Ibrahim Hashimi

1 Answers

0
votes

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)