用VS不同版本打开项目,报错:MS Build Error MSB4019: Microsoft.WebApplication.targets was not found...

本例是在用VS2008打开项目是报错 未找到C:\Program Files\MSBuild\Microsoft\VisualStudio\V10.0

In the last article Build and deploy web application project using NANT script i discusses how various options and configurations can be set on command line to overrride settings in Microsoft.WebAppliction.targets file. Well that worked perfectly fine. I was configuring a new build server for doing automated builds of the web application. I started getting following build error.

error MSB4019: The imported project "C:\ProgramFiles\MSBuild\Microsoft\VisualStudio\v10.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

Well this project was building fine on older machine. There are two options to fix this error.

Keep in mind that my development machine (from where I queue my build) is different than my TFS build machine.

So, there are two solution to this problem:

  1. Install Visual Studio 2010 (or the same version as in development machine) in your TFS server.
  2. Copy the “Microsoft.WebApplication.targets” from development machine file to TFS build machine.
The “Microsoft.WebApplications.targets” file is normally located under: “C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications”. The file will need to be copied to same path in TFS build machine.

That should take care of your build problems.

 

更详细的解答可以见:stackoverflow  或者http://stack247.wordpress.com/2011/08/29/the-imported-project-microsoft-webapplications-targets-was-not-found/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值