Skip to content

Hot Reload breaks when a web api project references and uses a class from a blazor.client project #63119

@chenegathoffman

Description

@chenegathoffman

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Hot reload works in a project until a web api project references and uses a class/record in a blazor.client project. The output of the hot reload windows will begin to classify the web api project as a Web Assembly project and it will break hot reload for the web assembly / server / interactive host project and the web api project.

https://github.com/chenegathoffman/hot-reload-is-broken/commits/master/

Before moving the record to the .client project.

Image

After moving the record to the .client project.

Image

Expected Behavior

I would expect that the Web Api project to continue to be classified as a (Web Server) project.

Steps To Reproduce

Create new blazor interactive project. Add a new web api project (minimal api template is fine). Add a reference to the .client project in the web api project. Set the solution to start up the blazor host and the web api project. Make a change to the weather forecast api endpoint and observe that it hot reloads. Move the WeatherForecast record into the .client project. Run the solution again, make the change to the web api and hot reload will break because it classifies the web api project as a Web Assembly project.

Exceptions (if any)

No response

.NET Version

.net core 9

Anything else?

No response

Metadata

Metadata

Assignees

Labels

area-commandlinetoolsIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPIfeature-hot-reloadThis issue is related to the Hot Reload feaature

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions