0
votes

I'm trying to build an ASP.NET Core Web application .NET Core 3.1.

I run MS Visual Studio 2019, latest build.

I created the "Controllers" folder, an error occurs when trying to add Controller:

Error: there was an error running the selected code generator package restore failed

API Controller empty.

To resolve the issue, I tried the following to no avail:

  • Delete folders .vs, bin, obj

  • Clean and Rebuild project

  • Clear all NuGet caches

  • Restart, reboot

For what I can find it seems related to:

Error NU1202. Package Microsoft.AspNetCore.Razor 2.2.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.AspNetCore.Razor 2.2.0 does not support any target frameworks.

How can I solve the problem?

1

1 Answers

0
votes

Resolved installing latest Visual Studio updates