简体   繁体   中英

Build VSTS error, failed to restore

I have code which gives the error on 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**

This error has come at the time of building my project online VSTS.

Here is the log:

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 

The log file said that the file: C:\\Program Files\\dotnet\\sdk\\2.1.300\\Microsoft\\VisualStudio\\v15.0\\WebApplications\\Microsoft.WebApplication.targets could not be found.

You can either:

  • Get this file from your local machine and push it to your git repository under a specific folder.

  • Find this file into the machine by writing script to search into your build agent for the file Microsoft.WebApplication.targets .

I've come across the same issue. There's seems to be something missing to build .NET Core 2.1 / ASP.NET Core 2.1 projects, or some configuration missing on the default templates.

I've yet to find something myself.

The error message is mainly caused building a ASP.NET (.Net framework) project with .NET Core restore task .

So you can double check with your project. And to build a ASP.NET project, you can use the ASP.NET build template with NuGet restore task instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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