Microsoft.Bcl.Build.targets" cannot be imported again

 warning MSB4011: "C:\workspace\Company\Finland\tow\develop\Source\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" cannot be imported again. It was already imported at "C:\workspace\Company\Finland\tow\develop\Source\EdenredFI.WOT.MAP.API\EdenredFI.WOT.MAP.API.csproj (87,3)". This is most likely a build authoring error. This subsequent import will be ignored. 

The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

 

https://devblogs.microsoft.com/dotnet/improved-package-restore/

 

NuGet 2.7 makes this a lot easier:

  1. You no longer need to enable package restore explicitly – when building in VS all packages are restored automatically.
  2. Running package restore on a build machine is now super easy. You only need to check-in NuGet.exe (nothing else) and you can put it wherever you want. It can even be in a well-known location on your build server and excluded from every solution if desired. Prior to the build you simply run nuget.exe restore pathtomysolution.sln.

Also, the NuGet team is talking to all major providers of build/CI servers (incl. TFS) so that at some point the second step can be handled automatically by the build servers. For more details, have a look at the NuGet 2.7 release notes and the new Package Restore documentation.

 

Summary

The new version of Microsoft.Bcl.Build will ensure that solutions containing our packages will load successfully even if packages aren’t restored yet. This affects all .NET NuGet packages that depend on it, such as Microsoft.Net.Http, Microsoft.Bcl, and Microsoft.Bcl.Async.

Microsoft.Bcl.Build will give an actionable error message in cases the package was missing by asking you to build again.

When coupled with NuGet 2.7 where package restore is automatic in Visual Studio and isn’t implemented through MSBuild, the experience is transparent and smooth. However, this doesn’t address build server scenarios yet so you still need run nuget.exe restore solution.sln prior to build, or check-in the .targets file if preferred.

作者:Chuck Lu    GitHub    
posted @   ChuckLu  阅读(224)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2019-08-12 HearthBuddy炉石兄弟 如何调试ai
2019-08-12 How to get full path of StreamWriter
2019-08-12 No suitable constructor was found in NUnit Parameterised tests
2015-08-12 Duplex Service in WCF(CodeProject上的)
2015-08-12 wcf双工通讯遇到的问题
2015-08-12 Duplex Services (Msdn)
2014-08-12 通过第三方软件打开sqlite
点击右上角即可分享
微信分享提示