TF270003: Failed to copy
msbuild, tfs, visual-studio-2013
Solution
In my build definition, I ended up creating a Sequence variable which I called `MSBuildToolPath` and set its value to `C:\Program Files (x86)\MSBuild\12.0\Bin`.
Still in my build definition, from there I found every `Run MSBuild for Project` activity and set their `ToolPath` property to the aforementioned `MSBuildToolPath` variable.
That had MSBuild finally using the correct version.
However, my happiness didn't last long because the next issue was that MSBuild couldn't locate the `*.metaproj` file.
After some research, we found that we could create an Environment System Variable of `MSBUILDEMITSOLUTION` and set its value to `1` to force the creation of that file.
Once that was done, we had a successful build where it created the `_PublishedWebsites\Zzz` folder and deployed to our web server ... finally!
Problem
This pertains to: - Visual Studio 2013 - Team Foundation Server 2010 Error: TF270003: Failed to copy. Ensure the source directory \\TFSFileStore\TFSBuild\Xxx\Yyy\_PublishedWebsites\Zzz exists and that you have the appropriate permissions. `_PublishedWebsites` does not exist. The problem is that it isn't being created by MSBuild. Even if I were to manually create those folders, the files don't get copied there. We just upgraded from Visual Studio 2010 to 2013. After perusing the log files, it seems as though the wrong MSBuild is being used. It's using: ``` C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe ``` when it should be using: ``` C:\Program Files (x86)\MSBuild\12.0\Bin\amd64\MSBuild.exe ``` Any ideas on how to get TFS to use the correct MSBuild executable? I followed http://hamidshahid.blogspot.com/2013/10/building-visual-studio-2013-solutions.html: 1) Find all instances of the MSBuild activity. The activity is named as “Run MSBuild for Project” within the build templates as show below: 2) Change the ToolsPath of the activity to point to the MSBuild 12.0 exe file as shown below: However ... the log in Diagnostic mode shows the following for Run MSBuild for Project: ``` Initial Property Values AdditionalVCOverrides = CommandLineArguments = /p:SkipInvalidConfigurations=true /tv:12.0 Configuration = Release GenerateVSPropsFile = True LogFile = LogFileDropLocation = \\Xxx\Yyy\Zzz\logs MaxProcesses = 1 OutDir = E:\Builds\Xxx\Binaries Platform = Any CPU Project = E:\Builds\Xxx\Xxx.sln ResponseFile = RunCodeAnalysis = AsConfigured Targets = TargetsNotLogged = String[] Array ToolPath = ToolPlatform = X86 Verbosity = Diagnostic C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe ``` Somehow, the `ToolPath` property that I set to: ``` C:\Program Files (x86)\MSBuild\12.0\Bin\amd64\ ``` is getting overridden and set to empty.