2

When I install Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation in a Web project and in Startup add :

 services.AddMvc().AddRazorRuntimeCompilation();

,the project does not run and the error is:

the project must provide a value for configuration

my .NET-Core version is 3.1

How can this be fixed?

2
  • Can you share the package references of the project file? Commented Jun 15, 2020 at 8:13
  • See the answer here: stackoverflow.com/a/65221807/88204 Commented Dec 9, 2020 at 17:26

1 Answer 1

5

There are some GitHub issues with this problem and some solutions that have worked for people. That said I would check to see that all NuGet packages are on versions supported by .NET Core 3.1. At this particular moment that means not too new so as to only work with .NET 5 and not too old so as to only work with Core 2.2.

Otherwise, someone suggested restarting VS.

https://github.com/dotnet/sdk/issues/9932

You may also try deleting Microsoft.AspNetCore.Razor.Design from the CsProj file per this duplicate question

Sign up to request clarification or add additional context in comments.

1 Comment

Deleting Microsoft.AspNetCore.Razor.Design from the CsProj file did the trick for me. Thank You!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.