core icon indicating copy to clipboard operation
core copied to clipboard

Aspnet core preview 2 build fails when restoring packages

Open takazm opened this issue 9 years ago • 14 comments

Aspnet core 2.0 build fails using vsts but builds successfully on local machine. During the build i get the following:

2017-08-09T21:02:23.8120816Z Package Microsoft.AspNetCore 2.0.0-preview2-final is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore 2.0.0-preview2-final supports: netstandard2.0 (.NETStandard,Version=v2.0) 2017-08-09T21:02:23.8120816Z Package Microsoft.AspNetCore.Hosting 2.0.0-preview2-final is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.Hosting 2.0.0-preview2-final supports: netstandard2.0 (.NETStandard,Version=v2.0) 2017-08-09T21:02:23.8120816Z Package Microsoft.AspNetCore.Hosting.Abstractions 2.0.0-preview2-final is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.Hosting.Abstractions 2.0.0-preview2-final supports: netstandard2.0 (.NETStandard,Version=v2.0) 2017-08-09T21:02:23.8120816Z Package Microsoft.AspNetCore.Http.Abstractions 2.0.0-preview2-final is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.Http.Abstractions 2.0.0-preview2-final supports: netstandard2.0 (.NETStandard,Version=v2.0) 2017-08-09T21:02:23.8130823Z Package Microsoft.AspNetCore.Mvc 2.0.0-preview2-final is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.Mvc 2.0.0-preview2-final supports: netstandard2.0 (.NETStandard,Version=v2.0) 2017-08-09T21:02:23.8130823Z Package Microsoft.AspNetCore.Mvc.ViewFeatures 2.0.0-preview2-final is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.Mvc.ViewFeatures 2.0.0-preview2-final supports: netstandard2.0 (.NETStandard,Version=v2.0) 2017-08-09T21:02:23.8130823Z Package Microsoft.AspNetCore.Routing 2.0.0-preview2-final is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.Routing 2.0.0-preview2-final supports: netstandard2.0 (.NETStandard,Version=v2.0) 2017-08-09T21:02:23.8130823Z Package Microsoft.AspNetCore.StaticFiles 2.0.0-preview2-final is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.StaticFiles 2.0.0-preview2-final supports: netstandard2.0 (.NETStandard,Version=v2.0) 2017-08-09T21:02:23.8130823Z One or more packages are incompatible with .NETCoreApp,Version=v2.0. 2017-08-09T21:02:23.8130823Z 2017-08-09T21:02:23.8130823Z NuGet Config files used: 2017-08-09T21:02:23.8130823Z C:\vsts-agent_work\25\Nuget\tempNuGet_738.config 2017-08-09T21:02:23.8130823Z 2017-08-09T21:02:23.8130823Z Feeds used: 2017-08-09T21:02:23.8130823Z https://api.nuget.org/v3/index.json 2017-08-09T21:02:23.8480839Z ##[error]Error: C:\vsts-agent_work_tool\NuGet\4.0.0\x64\nuget.exe failed with return code: 1 2017-08-09T21:02:23.8480839Z ##[error]Packages failed to restore My project file (.csproj) is as attached proj.txt :

takazm avatar Aug 09 '17 21:08 takazm

I just tried building on VSTS and have exactly the same problem. Builds just fine locally with VS 2017.3, but the "Restore" build step on VSTS fails. I'm using the 'Hosted VS2017' agent queue and the 'Version 2.* (preview)' (the only one available) in the restore step.

I will also attach my .csproj file csprojproject.txt

srpeterson avatar Aug 16 '17 20:08 srpeterson

I've got the same issue. Build on local VS2017.3 on my desktop. I've update my azure build agent on VS2017.3, with Netcore2.0 SDK, but it failed each

I attach my csproj file. csproj.txt

Pierl0 avatar Aug 17 '17 12:08 Pierl0

I've got the same issue. Build is fine locally with VS 2017.3. It seems that I am not alone, hopefully soon we find a solution for that. I attach my csproj.txt

dmoka avatar Aug 17 '17 17:08 dmoka

I have the same problem - try to update NuGet to version 4.3 on build machine.

rosieks avatar Aug 17 '17 17:08 rosieks

I had this problem and had to modify my build configuration. I answered a similar question with my solution on Stack Overflow: https://stackoverflow.com/questions/45717283/vsts-build-packages-failed-to-restore-unable-to-resolve-netstandard-library/45739237#45739237.

patoncrispy avatar Aug 18 '17 08:08 patoncrispy

Awesome, that worked for us too. Thanks @patoncrispy

jsheetzati avatar Aug 18 '17 13:08 jsheetzati

@patoncrispy Worked for us as well!

mdesenfants avatar Aug 18 '17 18:08 mdesenfants

Yep! Worked also for me!

srpeterson avatar Aug 18 '17 23:08 srpeterson

Works, Thanks

takazm avatar Aug 19 '17 09:08 takazm

No problem! I just wish these things were better documented, or at least, more visible.

patoncrispy avatar Aug 19 '17 09:08 patoncrispy

update your visual studio 2017 to latest version and it worked for me

hkshambesh avatar Nov 16 '17 11:11 hkshambesh

I'm on VS2017 15.4.4 and still can't build due to these errors. The weird thing is that it used to work, then I had to go back to a restore point due to blue screen issues and even after completely uninstalling and reinstalling VS it still won't build.

ghost avatar Nov 24 '17 06:11 ghost

@Jacquers , have you resolved this issue?

VinnieThePooh avatar May 25 '18 05:05 VinnieThePooh

It resolved when VS updated

ghost avatar May 25 '18 05:05 ghost