TFS Build with dotnet restore和4.5 Project

时间:2017-02-21 03:24:35

标签: .net tfs msbuild tfsbuild

我有一个.Net CORE(框架)项目,我想使用TFS构建和部署。我首先在解决方案上执行Nuget Restore Task,然后使用以下参数运行MSBuild Solution

  

/ p:DeployOnBuild = true / p:WebPublishMethod = Package / p:PackageAsSingleFile = true / p:SkipInvalidConfigurations = true / p:PackageLocation =“$(build.artifactstagingdirectory)\”(Visual Studio 2015版)

我得到请运行“dotnet restore”以生成新的锁定文件。消息,但我无法运行该消息,因为有一个引用的库是4.5并且dotnet cli错误项目。这有解决方法吗?

1 个答案:

答案 0 :(得分:1)

对于这种情况没有解决方法,您必须运行dotnet restore。

  

此行为是设计使然。 [...]如果您希望一次性恢复所有项目的所有依赖项,可以这么说,只需在解决方案的根目录下运行dotnet restore(您拥有global.json文件)。

     

From Zlatko Knezevic

对于4.5的“混合”解决方案,ASP.NET Core 1.0不支持msbuild。 enter image description here

您还可以在GITHub中查看这个类似问题:dotnet restore unable to resolve .NET Framework libraries (4.5.2)