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

Poorly formatted launchSettings.json and dotnet watch goes into production #45509

Open
JohnLErvin opened this issue Dec 17, 2024 · 4 comments
Open
Labels
Area-Watch untriaged Request triage from a team member

Comments

@JohnLErvin
Copy link

JohnLErvin commented Dec 17, 2024

Describe the bug

With an extra comma in the launchSettings.json file, dotnet watch goes into production mode by default.

To Reproduce

dotnet new web Api
cd Api 

Change launchSettings.json to the following leaving the superfluous comma after the "http" profile

{
  "$schema": "http://json.schemastore.org/launchsettings.json",
  "profiles": {
    "http": {
      "commandName": "Project",
      "dotnetRunMessages": true,
      "launchBrowser": true,
      "applicationUrl": "http://localhost:9001",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
  }
}

Now dotnet run will host as development while dotnet watch will host as production. ASPNETCORE_ENVIRONMENT=Development dotnet watch doesn't save you, but deleting the extra comma does.

Exceptions (if any)

None noted.

Further technical details

Working with VSCode

.NET SDK:
Version: 8.0.404
Commit: 7b190310f2
Workload version: 8.0.400-manifests.22517898
MSBuild version: 17.11.9+a69bbaaf5

Runtime Environment:
OS Name: debian
OS Version: 12
OS Platform: Linux
RID: linux-x64
Base Path: /usr/share/dotnet/sdk/8.0.404/

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
There are no installed workloads to display.

Host:
Version: 8.0.11
Architecture: x64
Commit: 9cb3b725e3

.NET SDKs installed:
6.0.428 [/usr/share/dotnet/sdk]
7.0.410 [/usr/share/dotnet/sdk]
8.0.404 [/usr/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.36 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.20 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.11 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.36 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.11 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Dec 17, 2024
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

1 similar comment
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@tmat
Copy link
Member

tmat commented Dec 18, 2024

@JohnLErvin Can you try .NET 9? It seems to work there.

@KalleOlaviNiemitalo
Copy link
Contributor

For .NET 8, this seems a duplicate of #38323.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Watch untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

4 participants