question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet build error - the project 'Web' must provide a value for Configuration

See original GitHub issue

Steps to reproduce

I run this command to build an aspnet core project(Web is the startup project)

dotnet build X.sln -c Release --no-cache --source “\\local_source\packages” --source “https://api.nuget.org/v3/index.json

Expected behavior

Build should be successful.

The same issue was raised by our TFS autobuild. When I tried on my local machine I get the same error. But I have no clue what could be wrong here. There is this post here but I doubt this is related to razor only. And also, the solution there was not very clear and (re-installing the sdk) won’t be an option (especially on the build server).

Actual behavior

I get the following error right after the packages has been restored:

C:\Users\MyUser\.nuget\packages\microsoft.aspnetcore.razor.design\2.1.1\build\netstandard2.0\Microsoft.AspNetCore.Razor.Design.CodeGeneration.targets(121,5): error : The project D:\Workspaces\X\src\Web must provide a value for Configuration. [D:\Workspaces\X\src\Web\Web.csproj]

Environment data

dotnet --info output:

.NET Core SDK (reflecting any global.json): Version: 2.1.403 Commit: 04e15494b6

Runtime Environment: OS Name: Windows OS Version: 6.1.7601 OS Platform: Windows RID: win7-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.403\

Host (useful for support): Version: 2.1.5 Commit: 290303f510

.NET Core SDKs installed: 1.0.4 [C:\Program Files\dotnet\sdk] 2.1.4 [C:\Program Files\dotnet\sdk] 2.1.102 [C:\Program Files\dotnet\sdk] 2.1.103 [C:\Program Files\dotnet\sdk] 2.1.104 [C:\Program Files\dotnet\sdk] 2.1.200 [C:\Program Files\dotnet\sdk] 2.1.201 [C:\Program Files\dotnet\sdk] 2.1.202 [C:\Program Files\dotnet\sdk] 2.1.300 [C:\Program Files\dotnet\sdk] 2.1.400 [C:\Program Files\dotnet\sdk] 2.1.402 [C:\Program Files\dotnet\sdk] 2.1.403 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:22 (3 by maintainers)

github_iconTop GitHub Comments

270reactions
tomRedoxcommented, Sep 3, 2019

I had this infuriating issue when migrating a .NET Core 2.2 app to core 3.0. The issue turned out to be that I was still referencing Microsoft.AspNetCore.Razor.Design Version=“2.2.0” in the .proj file’s package references. Deleting that reference (which isn’t needed at all as Razor.Design is now part of AspNetCore library) fixed the issue.

Once I’d done that, I then got hundreds of errors about nullable objects being a new feature not compatible with razor. That was because I had <LangVersion>Latest</LangVersion> in my .proj file. Removing that line fixed that issue and got the project running again.

You might need to restart VS too in some cases (see @JerryBian’s comment below).

(I’ve stuck this answer on Stack Overflow too to make it a bit more visible as it looks like a lot of people are having this issue. So if none of the above fixes the issue you could check that question too in case more answers get added there)

6reactions
JerryBiancommented, Sep 3, 2019

Exactly like @tomRedox explained.

For me just one additional step - restart Visual Studio to make it effective. Possible some cache file - not sure.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"The project 'Web' must provide a value for Configuration ...
I've migrated an ASP.NET Core 2.2 project to Core 3.0 and am getting the error: The project [Project location] must provide a value...
Read more >
Project must provide a value for Configuration
Hi! I have an issue with DevExpress.AspNetCore.Reporting package from NuGet. I migrate website to .net core 3.1 and I added references ...
Read more >
Issue when upgrading dotnet core 2.2 to 3.1: must provide a ...
The project D:\Code Repositories\MyProject must provide a value for ... .aspnetcore.razor.design\2.2.0\build\netstandard2.0\Microsoft.
Read more >
“The project 'Web' must provide a value for Configuration ...
I've migrated an ASP.NET Core 2.2 project to Core 3.0 and am getting the error: The project [Project location] must provide a value...
Read more >
The project 'Web' must provide a value for Configuration" error ...
Coding example for the question "The project 'Web' must provide a value for Configuration" error after migrating to .NET Core 3-.net-core.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found