繁体   English   中英

由于dotnet版本,VSTS建立在干净的基础上

[英]VSTS build on clean due to dotnet version

我的VSTS构建最近在进行clean时开始失败,似乎与所运行的dotnet版本有关。 如果我执行dotnet --version得到以下输出:

2018-05-31T16:40:51.0191791Z 2.1.300-rc1-008673

为什么构建代理运行的是RC版本的dotnet? 如何将其修复为发行版本?

环顾四周,为代理程序构建映像的脚本遇到了此更改,我想停止安装预览/ rc版本-https: //github.com/Microsoft/vsts-image-generation/commit/e9c0aec89ad797d1985a76ab262349b943b02c34目前正在构建的是rc版本?

这是我们打出运行dotnet clean clean阶段时来自VSTS的错误日志

2018-06-01T10:35:05.2388624Z ========================================
2018-06-01T10:35:05.2389045Z Clean
2018-06-01T10:35:05.2389205Z ========================================
2018-06-01T10:35:05.2389542Z Executing task: Clean
2018-06-01T10:35:05.2389744Z Microsoft (R) Build Engine version 15.7.177.53362 for .NET Core
2018-06-01T10:35:05.2389940Z Copyright (C) Microsoft Corporation. All rights reserved.
2018-06-01T10:35:05.2390085Z 
2018-06-01T10:35:05.2390243Z Build started 6/1/2018 10:35:04 AM.
2018-06-01T10:35:05.4567633Z      1>Project "D:\a\1\s\EvilCorp.Shopping.sln" on node 1 (Clean target(s)).
2018-06-01T10:35:05.4576926Z      1>ValidateSolutionConfiguration:
2018-06-01T10:35:05.4577117Z          Building solution configuration "Debug|Any CPU".
2018-06-01T10:35:05.4577301Z        ValidateProjects:
2018-06-01T10:35:05.4577538Z          The project "EvilCorp.Shopping.CloudFormation" is not selected for building in solution configuration "Debug|Any CPU".
2018-06-01T10:35:05.6568982Z      1>Project "D:\a\1\s\EvilCorp.Shopping.sln" (1) is building "D:\a\1\s\test\EvilCorp.Shopping.BitCoinMining.Tests\EvilCorp.Shopping.BitCoinMining.Tests.csproj" (2) on node 1 (Clean target(s)).
2018-06-01T10:35:05.6570131Z      2>_CheckForNETCoreSdkIsPreview:
2018-06-01T10:35:05.6570885Z          You are working with a preview version of the .NET Core SDK. You can define the SDK version via a global.json file in the current project. More at https://go.microsoft.com/fwlink/?linkid=869452
2018-06-01T10:35:05.6571157Z        CoreClean:
2018-06-01T10:35:05.6571366Z          Creating directory "obj\Debug\netcoreapp2.0\".
2018-06-01T10:35:05.6573173Z      2>C:\Program Files\dotnet\sdk\2.1.300-rc1-008673\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(197,5): error : Assets file 'D:\a\1\s\test\EvilCorp.Shopping.BitCoinMining.Tests\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. [D:\a\1\s\test\EvilCorp.Shopping.BitCoinMining.Tests\EvilCorp.Shopping.BitCoinMining.Tests.csproj]
2018-06-01T10:35:05.6574793Z      2>Done Building Project "D:\a\1\s\test\EvilCorp.Shopping.BitCoinMining.Tests\EvilCorp.Shopping.BitCoinMining.Tests.csproj" (Clean target(s)) -- FAILED.
2018-06-01T10:35:06.3974865Z      1>Project "D:\a\1\s\EvilCorp.Shopping.sln" (1) is building "D:\a\1\s\src\EvilCorp.Shopping.BitCoinMining\EvilCorp.Shopping.BitCoinMining.csproj" (3) on node 2 (Clean target(s)).
2018-06-01T10:35:06.3976276Z      3>_CheckForNETCoreSdkIsPreview:
2018-06-01T10:35:06.3976868Z          You are working with a preview version of the .NET Core SDK. You can define the SDK version via a global.json file in the current project. More at https://go.microsoft.com/fwlink/?linkid=869452
2018-06-01T10:35:06.4013004Z        CoreClean:
2018-06-01T10:35:06.4013409Z          Creating directory "obj\Debug\netcoreapp2.0\".
2018-06-01T10:35:06.4033872Z      3>C:\Program Files\dotnet\sdk\2.1.300-rc1-008673\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(197,5): error : Assets file 'D:\a\1\s\src\EvilCorp.Shopping.BitCoinMining\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. [D:\a\1\s\src\EvilCorp.Shopping.BitCoinMining\EvilCorp.Shopping.BitCoinMining.csproj]
2018-06-01T10:35:06.4039865Z      3>Done Building Project "D:\a\1\s\src\EvilCorp.Shopping.BitCoinMining\EvilCorp.Shopping.BitCoinMining.csproj" (Clean target(s)) -- FAILED.
2018-06-01T10:35:06.4237898Z      1>Done Building Project "D:\a\1\s\EvilCorp.Shopping.sln" (Clean target(s)) -- FAILED.
2018-06-01T10:35:06.4315334Z 
2018-06-01T10:35:06.4317290Z Build FAILED.
2018-06-01T10:35:06.4320946Z 
2018-06-01T10:35:06.4322792Z        "D:\a\1\s\EvilCorp.Shopping.sln" (Clean target) (1) ->
2018-06-01T10:35:06.4324451Z        "D:\a\1\s\test\EvilCorp.Shopping.BitCoinMining.Tests\EvilCorp.Shopping.BitCoinMining.Tests.csproj" (Clean target) (2) ->
2018-06-01T10:35:06.4324845Z        (ResolvePackageAssets target) -> 
2018-06-01T10:35:06.4325763Z          C:\Program Files\dotnet\sdk\2.1.300-rc1-008673\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(197,5): error : Assets file 'D:\a\1\s\test\EvilCorp.Shopping.BitCoinMining.Tests\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. [D:\a\1\s\test\EvilCorp.Shopping.BitCoinMining.Tests\EvilCorp.Shopping.BitCoinMining.Tests.csproj]
2018-06-01T10:35:06.4326110Z 
2018-06-01T10:35:06.4326235Z 
2018-06-01T10:35:06.4326444Z        "D:\a\1\s\EvilCorp.Shopping.sln" (Clean target) (1) ->
2018-06-01T10:35:06.4326731Z        "D:\a\1\s\src\EvilCorp.Shopping.BitCoinMining\EvilCorp.Shopping.BitCoinMining.csproj" (Clean target) (3) ->
2018-06-01T10:35:06.4327177Z          C:\Program Files\dotnet\sdk\2.1.300-rc1-008673\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(197,5): error : Assets file 'D:\a\1\s\src\EvilCorp.Shopping.BitCoinMining\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. [D:\a\1\s\src\EvilCorp.Shopping.BitCoinMining\EvilCorp.Shopping.BitCoinMining.csproj]
2018-06-01T10:35:06.4327515Z 
2018-06-01T10:35:06.4327682Z     0 Warning(s)
2018-06-01T10:35:06.4327863Z     2 Error(s)
2018-06-01T10:35:06.4327987Z 
2018-06-01T10:35:06.4328151Z Time Elapsed 00:00:01.51

我已经测试过,Hosted VS 2017已安装dotnet版本2.1.300-rc1-008673

在此处输入图片说明

要使用其他版本的dotnet sdk,可以按照以下步骤操作:

  1. 创建一个具有以下类似内容的global.json文件,并将其检入VSTS。

{ "sdk": { "version": "2.1.200" } }

  1. Working folder指定到global.json文件所在的位置:

在此处输入图片说明

  1. 运行命令:

在此处输入图片说明

您可以在第一步中指定要使用的dotnet sdk版本,并确保要使用的版本已在Hosted VS 2017中存在。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM