Skip to content

Blazor WebAssembly dotnet watch run --pathbase=/ doesn't work in .NET 8 #52294

Closed
@MaciekWin3

Description

@MaciekWin3

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Hi, after the latest update to .NET 8, I discovered that the --pathbase flag is not working as it should. In the previous version, the app was served from the specified path, but in the new version, it is being ignored. I am using this option to debug my Blazor Extension in Azure DevOps as I need to specify a different path than the default one. The command I am using is:

dotnet watch run --pathbase=/dist

Then the app is served from /dist folder, and I can access my app and debug easily using hot reloading. At the root level, I get this message: "The server is configured only to handle request URIs within the PathBase '/dist'." On .NET 8, this flag is simply ignored, and the app is served from the default path.

Expected Behavior

I expected the app to run from specified path with the dotnet watch run --pathbase=path command after updating to .NET 8, like it did before. But now, the flag isn't working, and the app runs from the default path instead.

Steps To Reproduce

To reproduce the issue, launch a Blazor WebAssembly project using the command dotnet watch run --pathbase=/dist and observe whether the application is served at the specified path ('/dist' in this case).

Exceptions (if any)

No response

.NET Version

8.0.100

Anything else?

No response

Metadata

Metadata

Assignees

Labels

area-commandlinetoolsIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPIbugThis issue describes a behavior which is not expected - a bug.feature-dotnetwatchThis issue is related to the dotnet-watch command-line tool (now external)triaged

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions