0
votes

Im using VS 2015 for all of our projects now, but this one particular web app is using web forms. Should be no big deal, since I can perform a publish locally on my workstation to the test server without issue.

Ive setup TeamCity before but now it seems Im having trouble getting a new instance configured. Using TeamCity 9.1.5 (build 37377), but without Visual Studio on the server.

Code is in a solution created with Visual Studio 2015.

Pretty much going along with these examples http://www.danmusk.com/how-to-build-asp-net-applications-in-teamcity-with-msbuild-tools-2013-and-net-framework-4-5-sdk/

Have installed MSBuild 2015 tools on the server

Upon running the build, I get this:

Microsoft.Web.Publishing.AspNetCompileMerge.targets(132, 5): Can't find the valid AspnetMergePath

My build step looks like this enter image description here

[update]
I think I might have found the culprit - I looked at the locations where the Windows SDK is supposedly installed and it was very sparse. The aspnetmerge tool was nowhere to be found. Gee, that might be why I get the error?

[ update ]

Using msbuild from the command line, I get Microsoft.Web.Publishing.AspNetCompileMerge.targets(133,5): error : Can't find the valid AspnetMergePath

Also, since starting this tread, Ive installed then Windows 10 SDK. My TeamCity build configuration works now. Ive updated my Microsoft.Web.Publishing.AspNetCompileMerge.targets file with this:

  <Target
      Name="GetAspNetMergePath"
      DependsOnTargets="$(GetAspNetMergePathDependsOn)"
      Condition ="'$(GetAspNetMergePath)' != 'false'">
    <PropertyGroup>
      <TargetFrameworkSDKToolsDirectory>C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\</TargetFrameworkSDKToolsDirectory>    
      <AspnetMergeName>aspnet_merge.exe</AspnetMergeName>
      <AspnetMergePath Condition="Exists('$(TargetFrameworkSDKToolsDirectory)$(AspnetMergeName)')">$(TargetFrameworkSDKToolsDirectory)</AspnetMergePath>
    </PropertyGroup>
    <Error Condition="'$(AspnetMergePath)' == '' Or !Exists($(AspnetMergePath))"
           Text="Can't find the valid AspnetMergePath" />
  </Target>
1
what's the result if you build and deploy project through MSBuild command directly?starian chen-MSFT
Based on your update, your issue has been solved, you can post an answer and mark it after 24 hours.starian chen-MSFT

1 Answers

1
votes

See the update in the original post. The server I was trying to build on had very minimal and old SDK's on it. I grabbed the latest Windows 10 SDK, installed and updated the Microsoft.Web.Publishing.AspNetCompileMerge.targets file as shown above. Then restarted both TeamCity services and the build finally worked.