I am having a problem with TFS2013 using a Team Build which does a build then a publish of a website.
Everything works fine when I do a Publish Web site from my dev machine using VS2013 and the (right-click) Publish Web site
option for the Web site project. I get the following error on the TFS2013 Build server:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Transform\Microsoft.Web.Publishing.AspNetCompileMerge.targets(421,5): error :
**Can't find the valid AspnetCompilerPath** [C:\Builds\3\Web\Development to WebDev\Sources\Web\Website\Development\ASP.NET\App\website.publishproj]
Done Building Project "C:\Builds\3\Web\Development to WebDev\Sources\Web\Website\Development\ASP.NET\App\website.publishproj" (default targets) -- FAILED.
**
I am using the follow MSBuild arguments in the Team Build setup.
/p:DeployOnBuild=true;VisualStudioVersion=12.0;DeployTarget=WebFileSystemPublish;PublishProfile=Development
The Development Web Transform works fine on the Build Server in response to the 'PublishProfile=Development' argument. The Web.Config file is properly transformed for our Development environment. As noted in the MSBuild Argument, I use the FileSystem publish option and want to keep it that way.
I have modified the Build Server 'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Transform\Microsoft.Web.Publishing.AspNetCompileMerge.targets' to log some properties as follows in Target 'ConfigureForAspNetPreCompileMerge':
<Message Text="[TargetFrameworkVersion]: $(TargetFrameworkVersion)" />
<Message Text="[AspnetCompilerPath]: $(AspnetCompilerPath)" />
<Message Text="[Framework40Dir]: $(Framework40Dir)" />
<Message Text="[MSBuildToolsRoot]: $(MSBuildToolsRoot)" />
<Message Text="[MSBuildRuntimeVersion]: $(MSBuildRuntimeVersion)" />
Which logs the following information to the website.log file for the Team Build: ConfigureForAspNetPreCompileMerge:
[TargetFrameworkVersion]: v4.0 [AspnetCompilerPath]: [Framework40Dir]: C:\Program Files (x86)\MSBuild\v4.0.30319 [MSBuildToolsRoot]: C:\Program Files (x86)\MSBuild\ [MSBuildRuntimeVersion]: 4.0.30319
The [Framework40Dir] is different than my local machine logging the same data at the same MSBuild target:
12> Task Parameter:Text=[TargetFrameworkVersion]: v4.0 12>
[TargetFrameworkVersion]: v4.0 12> Task Parameter:Text=[AspnetCompilerPath]: 12> [AspnetCompilerPath]: 12> Task Parameter:Text=[Framework40Dir]: C:\Windows\Microsoft.NET\Framework\v4.0.30319 12> [Framework40Dir]: C:\Windows\Microsoft.NET\Framework\v4.0.30319 12> Task Parameter:Text=[MSBuildToolsRoot]: C:\Program Files (x86)\MSBuild\ 12> [MSBuildToolsRoot]: C:\Program Files (x86)\MSBuild\ 12> Task Parameter:Text=[MSBuildFrameworkToolsRoot]: C:\Windows\Microsoft.NET\Framework\ 12>
[MSBuildFrameworkToolsRoot]: C:\Windows\Microsoft.NET\Framework\ 12>
Task Parameter:Text=[MSBuildRuntimeVersion]: 4.0.30319 12>
[MSBuildRuntimeVersion]: 4.0.30319
The TeamBuild value for [Framework40Dir] is: 'C:\Program Files (x86)\MSBuild\v4.0.30319' vs my local DEV machine of: C:\Windows\Microsoft.NET\Framework\v4.0.30319
This seems very unusual.
I have also changed the TeamBuild file: 'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Transform\Microsoft.Web.Publishing.AspNetCompileMerge.targets' to manually set the property of Framework40Dir as 'C:\Windows\Microsoft.NET\Framework\v4.0.30319' but that seems to hang the whole TeamBuild process when it gets to that point and runs the Team Build forever until I manually stop it.
This is the same solution that worked here: TFS Build Server cannot get publish profile to work: "Can't find the valid AspnetCompilerPath" but it doesn't work for me. That issue is identical to my problem.
The Build server is up to date with TFS2013.3. I do not have Visual Studio 2013 installed on that machine and would very much like not to do that. I have read that VS is not needed for TFS Team Builds.
Help with this issue is very much appreciated.....Thanks.