Sajithd
Sajithd

Reputation: 557

Package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation 5.0.0 is not compatible with netcoreapp3.1

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

Answers (3)

Kerox
Kerox

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

Yinqiu
Yinqiu

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

Sajithd
Sajithd

Reputation: 557

Installed version 3.1.10 and resolved.

PM> Install-Package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation -Version 3.1.10

Upvotes: 0

Related Questions