Skip to content

Publishing the default React template results in a 404 #45165

@julesrx

Description

@julesrx

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

After creating a new AspNetCore app using the "react" template, publishing it results in a blank screen and a 404 error.
The files inside wwwroot seems to be ignored.

Expected Behavior

Starting the published app should display the react app.

Steps To Reproduce

  1. dotnet new react -o my-app
  2. cd my-app
  3. disable the https redirection (for local startup) : // app.UseHttpsRedirection();
  4. dotnet publish -c Release
  5. dotnet .\bin\Release\net7.0\publish\my-app.dll

Exceptions (if any)

No response

.NET Version

7.0.100

Anything else?

One thing to note is that if I add an index.html in a manually created wwwroot, then disabling the csproj target that publish the spa app, the app was able to start correctly.

.NET SDK:
	Version:   7.0.100
	Commit:    e12b7af219
 
Runtime Environment:
	OS Name:     Windows
	OS Version:  10.0.19045
	OS Platform: Windows
	RID:         win10-x64
	Base Path:   C:\Program Files\dotnet\sdk\7.0.100\
 
Host:
	Version:      7.0.0
	Architecture: x64
	Commit:       d099f075e4

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesfeature-spaquestion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions