qbantek
qbantek

Reputation: 705

Teamcity: VS 2010 Solution fails to deploy after converting to VS 2012 Solution

I have a VS 2010 Solution containing asp.net C# projects, 4.0 Framework. We use Teamcity 7.1.1 (build 24074) as CI and deployment server.

We upgraded to Visual Studio 2012 and converted this solution, also installed Microsoft Visual Studio 2012 Shell (Integrated) Redistributable Package on the build server in order to have all files needed to build visual studio applications including [..]\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets.

After the conversion to 2012, I noticed that the deployment doesn't work anymore, the artifacts are not created (but Teamcity does not complain either!). I only get this on the build log:

[...]
[17:11:58][Providers\Providers.csproj.teamcity] GetCopyToOutputDirectoryItems
[17:11:58][Providers\Providers.csproj.teamcity] _CopyOutOfDateSourceItemsToOutputDirectoryAlways
[17:11:58][_CopyOutOfDateSourceItemsToOutputDirectoryAlways] Copy
[17:11:58][Copy] Copying file from "C:\TeamCity\buildAgent\work\c52628138e1ee4d4\Providers\NLog.config" to "bin\NLog.config".
[17:11:58][Providers\Providers.csproj.teamcity] CopyFilesToOutputDirectory
[17:11:58][CopyFilesToOutputDirectory] Copy
[17:11:58][Copy] Copying file from "obj\Release\Providers.dll" to "bin\Providers.dll".
[17:11:58][CopyFilesToOutputDirectory] Providers.csproj -> C:\TeamCity\buildAgent\work\c52628138e1ee4d4\Providers\bin\Providers.dll
[17:11:58][CopyFilesToOutputDirectory] Copy
[17:11:58][Copy] Copying file from "obj\Release\Providers.pdb" to "bin\Providers.pdb".

==> [17:11:58]Process exited with code 0

[17:11:58]Publishing internal artifacts
[17:11:58][Publishing internal artifacts] Sending build.finish.properties.gz file
[17:11:58]Publishing artifacts
[17:11:58][Publishing artifacts] Collecting files to publish: [Providers\obj\Release\Package]

==> [17:11:58][Publishing artifacts] Artifacts path Providers/obj/Release/Package not found

[17:11:58]Build finished

The only changes made to the solution were in the .sln and .csproj files (by Visual Studio). If I revert to the previous version, teamcity builds and deploys without issues. The changes to the project files were same as explained in this post, I tried the proposed solution (passing VisualStudioVersion=11.0 to MSBuild), it didn't work.

If I deploy from Visual Studio using the Publish link from Solution Explorer it also works as expected. I am going to create a new solution with a base project in VS 2012 and will test whether or not it deploys from Teamcity.

Any other ideas?

--- update ---

Hopefully, this is NOT the solution: I did the opposite as advised on the above post, I set the MSBuild parameter VisualStudioVersion=10.0 and it works! So, in order to deploy a VS 2012 project I had to treat it as VS 2010 project... What are you doing different? What I am supposed to do in order to be able to deploy without cheating teamcity?

--- update ---

I am adding some snapshots of my TeamCity Configuration. Teamcity passes the system and environment variables as build parameters to MSBuild.

General Settings

Build Steps

MSBuild

Configuration Parameters

Upvotes: 3

Views: 2210

Answers (1)

Richard Szalay
Richard Szalay

Reputation: 84734

Updated

To clarify, the issue is that the Web Publishing Pipeline targets ($(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets) aren't installed as part of the Integrated Shell edition of VS 2012.

The issue can be resolved by installing a full version of VS 2012 or, potentially, by installing the Azure SDK over the top of the VS Shell.

Upvotes: 3

Related Questions