简体   繁体   English

文件存在时,找不到TFS构建错误“ Microsoft.WebApplication.targets”。有时构建成功

[英]TFS build Error Microsoft.WebApplication.targets" was not found, while file exists. Sometimes build is success

I am using TFS 2013 to build my project but sometimes I am getting the error as: 我正在使用TFS 2013来构建我的项目,但有时会出现以下错误:

The imported project "C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v12.0\\WebApplications\\Microsoft.WebApplication.targets" was not found.Confirm that the path in the declaration is correct, and that the file exists on disk. 找不到导入的项目“ C:\\ Program Files(x86)\\ MSBuild \\ Microsoft \\ VisualStudio \\ v12.0 \\ WebApplications \\ Microsoft.WebApplication.targets”。确认声明中的路径正确,并且该文件存在在磁盘上。

I have gone through many answers and found a lot of workaround to fix it but “in my case the problem is that sometime my build is success and sometimes it is failing.” 我经历了很多答案,并找到了许多解决方法来解决它,但“就我而言,问题是我的构建有时会成功,有时会失败。”

Let say I am running my build for 10 times then 3-4 times it is passing and 6-7 times it is giving error. 假设我运行我的构建10次,然后通过3-4次,给出错误6-7次。

I have checked the path on server and the file 我已经检查了服务器和文件上的路径

"C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v12.0\\WebApplications\\Microsoft.WebApplication.targets" “ C:\\ Program Files(x86)\\ MSBuild \\ Microsoft \\ VisualStudio \\ v12.0 \\ WebApplications \\ Microsoft.WebApplication.targets”

exists at the same location where TFS build is looking for. 存在于TFS构建所需的同一位置。

I have also visited the link 我也访问了链接

TFS build errors a file not found, while file exists TFS构建错误,但文件存在时找不到文件

but there is no answer provided on this thread. 但是此线程上没有提供答案。

I want to do very minimal changes. 我想做很小的改动。 Please suggest what would be the possible solution to make .targets file always available. 请提出使.targets文件始终可用的可行解决方案。

Update: 更新:

I have found a similar question at the link 我在链接上找到了类似的问题

TFS Build missing .targets files intermittently TFS间歇性地生成丢失的.targets文件

but the answer provided at this thread does not solve my problem and even if it's a kind of question again not the solution that's why I have started a separate thread. 但是此线程提供的答案不能解决我的问题,即使这又是一种问题,也不是解决方案,这就是为什么我启动了一个单独的线程。

You may try the items below: 您可以尝试以下项目:

  1. Clean the Cache folder on your build agent machine. 清理构建代理计算机上的Cache文件夹。 The folder path is: C:\\Users\\username\\AppData\\Local\\Microsoft\\Team Foundation\\5.0\\Cache . 文件夹路径为: C:\\Users\\username\\AppData\\Local\\Microsoft\\Team Foundation\\5.0\\Cache
  2. Clean the cache folder on your TFS machine: C:\\Program Files\\Microsoft Team Foundation Server 12.0\\Application Tier\\Web Services\\_tfs_data 清理TFS计算机上的缓存文件夹: C:\\Program Files\\Microsoft Team Foundation Server 12.0\\Application Tier\\Web Services\\_tfs_data
  3. Try to use the NuGet package MSBuild.Microsoft.VisualStudio.Web.targets , referencing them in your project. 尝试使用NuGet包MSBuild.Microsoft.VisualStudio.Web.targets ,在项目中引用它们。
  4. Try to create another light project to test whether you would get the same issue. 尝试创建另一个轻型项目以测试是否会遇到相同的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 缺少 MS-Build 2017“Microsoft.WebApplication.targets” - MS-Build 2017 "Microsoft.WebApplication.targets " is missing msbuild无法与tfs 2010和importet Microsoft.TeamFoundation.Build.targets一起正常使用 - msbuild not working properly with tfs 2010 and importet Microsoft.TeamFoundation.Build.targets 在TFS构建期间调用自定义Umbraco目标 - Call custom Umbraco targets during TFS build 使用VS 2013和TFS 2013构建vdproj文件-出现构建错误-验证时发生错误。 HRESULT ='8000000A' - Build vdproj file with VS 2013 and TFS 2013 - getting a build error - An error occurred while validating. HRESULT = '8000000A' Flutter 窗口:构建过程失败:\\Microsoft.CppCommon.targets(241,5):错误 MSB8066 - Flutter windows: build process failed: \Microsoft.CppCommon.targets(241,5): error MSB8066 TFS构建服务器-共享项目构建错误 - TFS build server - Shared Projects build error 导入目标文件以扩展VS2017中的构建目标 - Import targets file to extend build targets in VS2017 覆盖另一个目标文件的构建事件后的目标 - Overwrite targets post build event of another targets file TFS 2010团队构建错误 - TFS 2010 Team Build Error TFS生成问题与App.config文件(错误3719) - TFS Build Issue with App.config file (Error 3719)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM