建立VSTS错误,还原失败

时间:2018-07-04 06:17:37

标签: c# .net azure-devops

我有在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 

3 个答案:

答案 0 :(得分:1)

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

您可以:

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

  • 通过编写脚本以在文件的构建代理中搜索文件Microsoft.WebApplication.targets,将文件查找到计算机中。

答案 1 :(得分:0)

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

我还没有找到自己的东西。

答案 2 :(得分:0)

错误消息主要是由于使用.NET Core还原任务构建ASP.NET(.Net框架)项目

因此您可以仔细检查您的项目。而要构建ASP.NET项目,可以将ASP.NET构建模板与 NuGet恢复任务一起使用。