I'm currently integrating CI into our development and deployment process. Here is one Problem I ran into:
I was following along the beatufully collected informations on Troy Hunts Blog when suddenly an error occured:
error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
TeamCity is trying to tell me that I don't have the Visual Studio 2012 Web Application Support installed. Unfortunately, I won't do that, mainly because of licensing issues.
But there is an easy solution to this. Install the MSBuild.Microsoft.VisualStudio.Web.targets Package into your Solution and replace the old reference:
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
With this new one, which would use the NuGet installed package:
<Import Project="..\packages\MSBuild.Microsoft.VisualStudio.Web.targets.126.96.36.199\tools\VSToolsPath\WebApplications\Microsoft.WebApplication.targets" Condition="true" />
Hope this helps.
EDIT: I've just had the same thing again today, and I noticed that I forgot to mention, that this all is nice and fine, but you need to provide an ApplicationPool and SiteName as a 'DeployIisAppPath' too, like this:
You have to put it under your configurations property group for the project. For me it's always the second or third(Debug/Release) property group xml tag, it looks similar to this:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">