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.

The --launch-profile option of `dotnet run` and `dotnet watch run` should fallback to a case-insensitive match if a case-sensitive match isn't found

See original GitHub issue

Today, dotnet run --launch-profile profilename and dotnet watch run --launch-profile profilename are case-sensitive and if a matching profile is not found in launchSettings.json an error message is displayed but the project is run anyway, e.g.:

launchSettings.json

{
  "profiles": {
    "http": {
      "commandName": "Project",
      "dotnetRunMessages": true,
      "launchBrowser": true,
      "applicationUrl": "http://localhost:5130",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "HTTPS": {
      "commandName": "Project",
      "dotnetRunMessages": true,
      "launchBrowser": true,
      "applicationUrl": "https://localhost:7175;http://localhost:5130",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}
$ dotnet run --launch-profile https
The launch profile "https" could not be applied.
A profile with the specified name could not be found or is not a valid JSON object.
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5000

It would be more user-friendly in cases like this to simply fallback to a case-insensitive match if a case-sensitive match is not found first.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
baronfelcommented, Jun 14, 2022

Thanks for the help narrowing down on this. I put it in the 7 backlog and we’ll get to it as we can! I do think this would be a good area for @nagilson after he tackles the various Release configuration/RID inference changes for 7 if nothing else crazy pops up.

1reaction
baronfelcommented, Jun 14, 2022

What about something like this:

  • if the name is case-insensitively unique (i.e. http in your image above), then accept any case
  • if the name has case-sensitive variants, require case-sensitive matches or else error
  • completions always suggest the user-entered spellings exactly
Read more comments on GitHub >

github_iconTop Results From Across the Web

The launch profile "(Default)" could not be applied - ...
I'm setting up my project to use dotnet watch run in my launchSettings.json under Visual Studio 2019 Preview 16.9.0.
Read more >
How to enable case-insensitive property name matching ...
Learn how to enable case-insensitive property name matching while serializing to and deserializing from JSON in .NET.
Read more >
Aspnet Core Project Json | PDF | Microsoft Visual Studio
Run the app (the dotnet run command will build the app when it's out of date): ... Text matching is case-insensitive and based...
Read more >
Routing is case sensitive? : r/Blazor
I think I'm just missing something here. How can I have case-insensitivity without having to code the controller name into the Route attribute ......
Read more >
aspnet-core-project-json
Run the app (the dotnet run command will build the app when it's out of ... Text matching is case-insensitive and based on...
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