Visual Studio 2010 seems to insist on having this import in web application projects
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
What does this import give us and is it really required?
On a side note if you remove this import with a text editor Visual studio will re-add it.
The reason i am asking is when the project is compiled on a build server that target does nor exists because visual studio is not installed.
"C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk\5.0. 406\Microsoft\VisualStudio\v15. 0\WebApplications\Microsoft. WebApplication.
The DeployOnBuild property instructs MSBuild to run any deployment instructions in the project settings when the build of each project is complete.
As suggested in the comments to Raj Kaimal's answer, to get this working you can copy over the folder to the same location on the build machine.
If you want, you can also put that folder somewhere else in your machine, even relative to your project. You just need to add something to the csproj to redirect MSBuildExtensionsPath..
For example, I have the following in my csproj (works for VS2010 and VS2012):
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<PropertyGroup>
<MSBuildExtensionsPath32>..\lib\MSBuild.MSVS\</MSBuildExtensionsPath32>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets"/>
Then, within my lib folder (which is a sibling of the folder containing the csproj), I have copied the following directories:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With