【问题标题】:Build VSTS error, failed to restore构建 VSTS 错误,无法恢复
【发布时间】:2018-07-04 06:17:37
【问题描述】:

我有在 VSTS 上给出错误的代码。

2018-07-03T12:42:19.3444686Z ##[error]Error: C:\Program Files\dotnet\dotnet.exe failed with return code: 1
2018-07-03T12:42:19.3445690Z ##[error]Packages failed to restore
2018-07-03T12:42:19.3890517Z ##[section]Finishing: Restore**

此错误是在我在线构建项目 VSTS 时出现的。

这是日志:

2018-07-03T12:42:00.8859572Z ##[section]Finishing: Get Sources
2018-07-03T12:42:00.8878622Z ##[section]Starting: Restore
2018-07-03T12:42:00.9483797Z ==============================================================================
2018-07-03T12:42:00.9483938Z Task         : .NET Core
2018-07-03T12:42:00.9484123Z Description  : Build, test, package, or publish a dotnet application, or run a custom dotnet command. For package commands, supports NuGet.org and authenticated feeds like Package Management and MyGet.
2018-07-03T12:42:00.9484523Z Version      : 2.135.0
2018-07-03T12:42:00.9484621Z Author       : Microsoft Corporation
2018-07-03T12:42:00.9484769Z Help         : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
2018-07-03T12:42:00.9484892Z ==============================================================================
2018-07-03T12:42:16.9645020Z [command]C:\Windows\system32\chcp.com 65001
2018-07-03T12:42:17.2945010Z Active code page: 65001
2018-07-03T12:42:17.4326246Z SYSTEMVSSCONNECTION exists true
2018-07-03T12:42:17.4355349Z Saving NuGet.config to a temporary config file.
2018-07-03T12:42:17.4543271Z ##[warning]No package sources were found in the NuGet.config file at D:\a\1\Nuget\tempNuGet_4.config
2018-07-03T12:42:17.4868536Z [command]"C:\Program Files\dotnet\dotnet.exe" restore D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj --configfile D:\a\1\Nuget\tempNuGet_4.config --verbosity Detailed
2018-07-03T12:42:17.8736022Z Build started 7/3/2018 12:42:17 PM.
2018-07-03T12:42:17.9520390Z      0>Property reassignment: $(MSBuildProjectExtensionsPath)="D:\a\1\s\VSTSDemo\VSTSDemo\obj\" (previous value: "obj\") at C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.props (60,5)
2018-07-03T12:42:18.1325239Z        Property reassignment: $(MSBuildAllProjects)=";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props" (previous value: ";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets") at C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props (29,5)
2018-07-03T12:42:18.5600019Z        Property reassignment: $(_DebugSymbolsProduced)="true" (previous value: "false") at C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets (148,5)
2018-07-03T12:42:18.5600878Z        Property reassignment: $(_DocumentationFileProduced)="false" (previous value: "true") at C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets (157,5)
2018-07-03T12:42:18.5608318Z        Property reassignment: $(ProcessorArchitecture)="msil" (previous value: "") at C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets (486,5)
2018-07-03T12:42:18.5635800Z        Property reassignment: $(DelaySign)="" (previous value: "false") at C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets (525,5)
2018-07-03T12:42:18.5642421Z        Property reassignment: $(MSBuildAllProjects)=";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets" (previous value: ";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props") at C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets (536,5)
2018-07-03T12:42:18.5642998Z        Property reassignment: $(_SGenGenerateSerializationAssembliesConfig)="Auto" (previous value: "") at C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets (3496,5)
2018-07-03T12:42:18.5643285Z        Property reassignment: $(_SGenGenerateSerializationAssembliesConfig)="Off" (previous value: "Auto") at C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets (3497,5)
2018-07-03T12:42:18.6720829Z        Property reassignment: $(MSBuildAllProjects)=";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets" (previous value: ";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets") at C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets (29,6)
2018-07-03T12:42:18.6771849Z        Property reassignment: $(ResolveReferencesDependsOn)="
2018-07-03T12:42:18.6772330Z              
2018-07-03T12:42:18.6772499Z              BeforeResolveReferences;
2018-07-03T12:42:18.6772699Z              AssignProjectConfiguration;
2018-07-03T12:42:18.6772889Z              ResolveProjectReferences;
2018-07-03T12:42:18.6773070Z              FindInvalidProjectReferences;
2018-07-03T12:42:18.6773272Z              ResolveNativeReferences;
2018-07-03T12:42:18.6773441Z              ResolveAssemblyReferences;
2018-07-03T12:42:18.6773609Z              GenerateBindingRedirects;
2018-07-03T12:42:18.6773780Z              ResolveComReferences;
2018-07-03T12:42:18.6773971Z              AfterResolveReferences
2018-07-03T12:42:18.6774142Z            ;
2018-07-03T12:42:18.6774307Z              ImplicitlyExpandDesignTimeFacades
2018-07-03T12:42:18.6774499Z            " (previous value: "
2018-07-03T12:42:18.6774667Z              BeforeResolveReferences;
2018-07-03T12:42:18.6774836Z              AssignProjectConfiguration;
2018-07-03T12:42:18.6775025Z              ResolveProjectReferences;
2018-07-03T12:42:18.6775198Z              FindInvalidProjectReferences;
2018-07-03T12:42:18.6775366Z              ResolveNativeReferences;
2018-07-03T12:42:18.6775696Z              ResolveAssemblyReferences;
2018-07-03T12:42:18.6775955Z              GenerateBindingRedirects;
2018-07-03T12:42:18.6776107Z              ResolveComReferences;
2018-07-03T12:42:18.6776254Z              AfterResolveReferences
2018-07-03T12:42:18.6776454Z            ") at C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets (79,5)
2018-07-03T12:42:18.6777621Z        Property reassignment: $(MSBuildAllProjects)=";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets" (previous value: ";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets") at C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets (45,5)
2018-07-03T12:42:18.6779244Z        Property reassignment: $(MSBuildAllProjects)=";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets;C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NET.Build.Extensions.targets" (previous value: ";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets") at C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NET.Build.Extensions.targets (14,5)
2018-07-03T12:42:18.6780911Z        Property reassignment: $(MSBuildAllProjects)=";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets;C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets" (previous value: ";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets;C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NET.Build.Extensions.targets") at C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets (15,5)
2018-07-03T12:42:18.8082724Z        Property reassignment: $(MSBuildAllProjects)=";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets;C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.NETFramework.targets" (previous value: ";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets;C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets") at C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.NETFramework.targets (15,5)
2018-07-03T12:42:18.8483693Z        Property reassignment: $(MSBuildAllProjects)=";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets;C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.NETFramework.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets" (previous value: ";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets;C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.NETFramework.targets") at C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets (15,5)
2018-07-03T12:42:18.9739481Z        Property reassignment: $(MSBuildAllProjects)=";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets;C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.NETFramework.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.DefaultPackageConflictOverrides.targets" (previous value: ";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets;C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.NETFramework.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets") at C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.DefaultPackageConflictOverrides.targets (15,5)
2018-07-03T12:42:18.9743559Z        Property reassignment: $(MSBuildAllProjects)=";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets;C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.NETFramework.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.DefaultPackageConflictOverrides.targets;C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.TestPlatform.ImportAfter.targets" (previous value: ";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets;C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.NETFramework.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.DefaultPackageConflictOverrides.targets") at C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.TestPlatform.ImportAfter.targets (16,5)
2018-07-03T12:42:18.9756277Z        Property reassignment: $(MSBuildAllProjects)=";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets;C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.NETFramework.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.DefaultPackageConflictOverrides.targets;C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.TestPlatform.ImportAfter.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.TestPlatform.targets" (previous value: ";C:\Program Files\dotnet\sdk\2.1.300\Microsoft.CSharp.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.props;D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.Common.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft.NETFramework.CurrentVersion.targets;C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets;C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.NETFramework.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets;C:\Program Files\dotnet\sdk\2.1.300\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.DefaultPackageConflictOverrides.targets;C:\Program Files\dotnet\sdk\2.1.300\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.TestPlatform.ImportAfter.targets") at C:\Program Files\dotnet\sdk\2.1.300\Microsoft.TestPlatform.targets (17,5)
2018-07-03T12:42:19.2724137Z      1>Project "D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj" on node 1 (Restore target(s)).
2018-07-03T12:42:19.2728383Z      1>Building with tools version "15.0".
2018-07-03T12:42:19.2988664Z      1>D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj(293,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.1.300\Microsoft\VisualStudio\v15.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.
2018-07-03T12:42:19.2989104Z      1>Done Building Project "D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj" (Restore target(s)) -- FAILED.
2018-07-03T12:42:19.3105724Z 
2018-07-03T12:42:19.3106408Z Build FAILED.
2018-07-03T12:42:19.3112023Z 
2018-07-03T12:42:19.3112348Z        "D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj" (Restore target) (1) ->
2018-07-03T12:42:19.3113744Z          D:\a\1\s\VSTSDemo\VSTSDemo\VSTSDemo.csproj(293,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.1.300\Microsoft\VisualStudio\v15.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.
2018-07-03T12:42:19.3114127Z 

【问题讨论】:

  • 您能否通过添加值为true 的构建变量system.debug 来显示详细日志?
  • 在我的 web.config 文件中已将 debug 设置为 true
  • 这里能不能也显示一下VSTSDemo.csproj文件的内容?
  • 另外,你用什么VS版本开发.net core项目?使用托管 VS2017 代理,仅安装 VS2017。

标签: c# .net azure-devops


【解决方案1】:

日志文件说找不到文件:C:\Program Files\dotnet\sdk\2.1.300\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets

您可以:

  • 从您的本地计算机获取此文件并将其推送到特定文件夹下的 git 存储库。

  • 通过编写脚本在您的构建代理中搜索文件Microsoft.WebApplication.targets,在机器中找到此文件。

【讨论】:

    【解决方案2】:

    错误信息主要是用.NET Core恢复任务构建ASP.NET(.Net framework)项目

    因此,您可以仔细检查您的项目。而要构建 ASP.NET 项目,您可以使用带有 NuGet restore task 的 ASP.NET 构建模板。

    【讨论】:

      【解决方案3】:

      我遇到了同样的问题。构建 .NET Core 2.1 / ASP.NET Core 2.1 项目似乎缺少一些东西,或者默认模板上缺少一些配置。

      我自己还没有找到。

      【讨论】:

        猜你喜欢
        • 2019-01-14
        • 1970-01-01
        • 2018-05-07
        • 2017-03-23
        • 1970-01-01
        • 2016-11-13
        • 2018-12-24
        • 2018-08-24
        • 1970-01-01
        相关资源
        最近更新 更多