You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be a regression/change of behavior in how dotnet run handles command line arguments.
I have an ASP.NET core application targeting .NET 9. We have migrated from SDK 9.0.103 to 9.0.200 last week and immediately started having issues with our test pipelines. I tracked the issue to the behavior of dotnet run.
Our command line: dotnet run --environment UiTests --urls https://localhost:7139
In 9.0.103, this produced the following output (parts omitted for brevity):
Using launch settings from [path]\launchSettings.json...
Building...
[11:57:51 INF] User profile is available. Using '[user profile]\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
[11:57:52 WRN] The ASP.NET Core developer certificate is not trusted. For information about trusting the ASP.NET Core developer certificate, see https://aka.ms/aspnet/https-trust-dev-cert
[11:57:52 INF] Now listening on: https://localhost:7139
[11:57:52 INF] [app] application 'Started'
[11:57:52 INF] Application started. Press Ctrl+C to shut down.
[11:57:52 INF] Hosting environment: UiTests
[11:57:52 INF] Content root path: [root path]
In 9.0.200, this has changed:
Using launch settings from [path]\launchSettings.json...
Building...
[11:59:36 INF] User profile is available. Using '[user profile]\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
[11:59:37 WRN] The ASP.NET Core developer certificate is not trusted. For information about trusting the ASP.NET Core developer certificate, see https://aka.ms/aspnet/https-trust-dev-cert
[11:59:37 INF] Now listening on: https://localhost:7139
[11:59:37 INF] [app] application 'Started'
[11:59:37 INF] Application started. Press Ctrl+C to shut down.
[11:59:37 INF] Hosting environment: Development
[11:59:37 INF] Content root path: [root path]
Note the difference in Hosting environment. It looks like in 9.0.200, the --environment was not passed to the application being run.
If I change the command line to dotnet run -- --environment UiTests --urls https://localhost:7139, we get the expected output:
Using launch settings from [path]\launchSettings.json...
Building...
[12:02:14 INF] User profile is available. Using '[user profile]\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
[12:02:14 WRN] The ASP.NET Core developer certificate is not trusted. For information about trusting the ASP.NET Core developer certificate, see https://aka.ms/aspnet/https-trust-dev-cert
[12:02:14 INF] Now listening on: https://localhost:7139
[12:02:14 INF] [app] application 'Started'
[12:02:14 INF] Application started. Press Ctrl+C to shut down.
[12:02:14 INF] Hosting environment: UiTests
[12:02:14 INF] Content root path: [root path]
I wasn't able to find any documentation about this change, in fact, this documentation still contains the old format without the -- separator. Is this change expected? If so, I think this is a breaking change that should be documented somewhere. If not, I guess this is a bug report.
The text was updated successfully, but these errors were encountered:
Describe the bug
There seems to be a regression/change of behavior in how
dotnet run
handles command line arguments.I have an ASP.NET core application targeting .NET 9. We have migrated from SDK 9.0.103 to 9.0.200 last week and immediately started having issues with our test pipelines. I tracked the issue to the behavior of
dotnet run
.Our command line:
dotnet run --environment UiTests --urls https://localhost:7139
In 9.0.103, this produced the following output (parts omitted for brevity):
In 9.0.200, this has changed:
Note the difference in
Hosting environment
. It looks like in 9.0.200, the--environment
was not passed to the application being run.If I change the command line to
dotnet run -- --environment UiTests --urls https://localhost:7139
, we get the expected output:I wasn't able to find any documentation about this change, in fact, this documentation still contains the old format without the
--
separator. Is this change expected? If so, I think this is a breaking change that should be documented somewhere. If not, I guess this is a bug report.The text was updated successfully, but these errors were encountered: