Error in Visual Studio 2017: Package Microsoft.Extensions... compatible with netcoreapp2.0

I've created a blank Radzen app, added a single page and built it. When I try to edit the "application.sln" file in VS2017 Professional I am getting 136 errors, all similar to this...

Severity Code Description Project File Line Suppression State
Error Package Microsoft.EntityFrameworkCore.Tools.DotNet 2.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.EntityFrameworkCore.Tools.DotNet 2.0.0 supports: netcoreapp2.0 (.NETCoreApp,Version=v2.0) 0

Severity Code Description Project File Line Suppression State
Error Package Microsoft.AspNetCore.SpaServices 2.0.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.SpaServices 2.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0) 0

Severity	Code	Description	Project	File	Line	Suppression State
Error		Package Microsoft.AspNetCore.Mvc.Core 2.0.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.Mvc.Core 2.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)			0	

Can someone please help me resolve this?
Thank you!

You are trying to run .NET Core 1.x project while you have only .NET Core 2.x installed. You can change Radzen app .NET Core version from project settings.

@enchev - Can you please clarify?

I've cleared all my Radzen projects and have downloaded the latest version.
I've created two different projects

zfDemo_dotNet1 --> this targets dotnet code 1.x

  • After adding a single page and building, the "application.sln" file IS NOT created.

zfDemo_dotNet2 --> this targets dotNet core 2.x

  • After adding a single page and building, the "application.sln" file IS created.
  • If I open the "application.sln" file in VS2017, I am still receiving the 136 errors mentioned in my original post.

What have I missed?
Thanks!

Is the application running as expected from Radzen?
Did you use by any chance the same directory for both applications?

The error message looks as if .NET 2.0 assemblies are being used in a .NET 1.0 application. You can try deleting the server directory of your Radzen application and run it again so the code gets regenerated.

@korchev
Yes, the Radzen project runs as expected - granted, its not doing anything as I only have on page.

The projects are in two different directories (see screen shot)...

Per your request, I deleted the "server" folder and re-built/ran the Radzen project. The folder was recreated, but the errors remain.

This is what I noticed in the output in VS2017 when I open the "application.sln"...

Restoring NuGet packages...
Package Microsoft.EntityFrameworkCore.Tools.DotNet 2.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.EntityFrameworkCore.Tools.DotNet 2.0.0 supports: netcoreapp2.0 (.NETCoreApp,Version=v2.0)
One or more packages are incompatible with .NETCoreApp,Version=v1.0.
Package Microsoft.AspNetCore.OData 7.0.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.OData 7.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)
Package Microsoft.EntityFrameworkCore.Tools 2.0.3 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.EntityFrameworkCore.Tools 2.0.3 supports: netstandard2.0 (.NETStandard,Version=v2.0)
Package Microsoft.AspNetCore.SpaServices.Extensions 2.0.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.SpaServices.Extensions 2.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)

....

One or more packages are incompatible with .NETCoreApp,Version=v2.0.
NuGet package restore failed.
Time Elapsed: 00:00:05.2040168
========== Finished ==========

Could it be outdated nuget or some other Visual Studio package? This stackoverflow thread discusses the same error message.

ugh. welp, guess it was something in VisualStudio that need to be updated. Forced an update to VS2017 v15.9.7 and after many build attempts, the errors in Visual Studio are gone. Not really sure what fixed it, but thanks for the link/tip.

1 Like