Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
herme063 opened this issue Nov 14, 2018 · 7 comments

Comments

@herme063
Copy link

commented Nov 14, 2018

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: 04e1549

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

@herme063 herme063 changed the title dotnet build error - the project 'X' must provide a value for Configuration dotnet build error - the project 'Web' must provide a value for Configuration Nov 14, 2018

@livarcocc

This comment has been minimized.

Copy link
Member

commented Nov 14, 2018

Have you tried building the project instead of the solution?

@livarcocc livarcocc added this to the Discussion milestone Nov 14, 2018

@herme063

This comment has been minimized.

Copy link
Author

commented Nov 15, 2018

I did try to pass the startup project as parameter, yet I get the same error.

I forgot to mention that the solution is built fine under visual studio 17.
It just won't work on the command line.

@livarcocc

This comment has been minimized.

Copy link
Member

commented Nov 15, 2018

Any chance you can provide a small repro repo? that we can clone and repro the issue ourselves?

@herme063

This comment has been minimized.

Copy link
Author

commented Nov 16, 2018

I am trying to make replicate the issue with a standalone/shareable project but no luck so far. The current code base where this is happening is a proprietary code thus I am unable to share it.

@herme063

This comment has been minimized.

Copy link
Author

commented Nov 19, 2018

So when I specified the target framework (-f|--framework) then the build/publish was successful.

@yepeekai

This comment has been minimized.

Copy link

commented Jan 11, 2019

my 2 cents: I had to use the metapackage Microsoft.AspNetCore.App in order to get rid of this error.

@tomRedox

This comment has been minimized.

Copy link

commented May 21, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.