Reputation: 557
I'm trying to install Nuget package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation on a .Net core 3.1 project and getting following error. "Package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation 5.0.0 is not compatible with netcoreapp3.1"
I have already updated all the existing packages but no luck. Has anyone encountered this error?
Upvotes: 11
Views: 12568
Reputation: 760
For me this one worked in the integrated VS terminal.
dotnet add package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation --version 3.1.10
Upvotes: 4
Reputation: 7180
Because Package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation 5.0.0
depends on net5.0
.
You should install a version compatible with .net core 3.1
,like Package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation -Version 3.x
Upvotes: 21
Reputation: 557
Installed version 3.1.10 and resolved.
PM> Install-Package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation -Version 3.1.10
Upvotes: 0