Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blazor app is not starting when host environment name is changed from Development #43110

Closed
1 task done
voroninp opened this issue Aug 5, 2022 · 3 comments
Closed
1 task done
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question Status: Resolved

Comments

@voroninp
Copy link
Contributor

voroninp commented Aug 5, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

The problem is that index.html file resides in Blazor project.
There's an API which processes .staticwebassets.runtime.json file, so static assets are served correctly when running not published app with dotnet run.

But default app builder uses it only for dev environment.

If I add this call, Blazor works again (with debug mode, though, but you already have tickets for this).

Expected Behavior

I'd propose default templates (and docs as well) contain a commented section with the explanation that this call must be used for any other environment:

// Uncomment it, if you are developing using Environment name other than `Development`
// See docs: .... some link.
// StaticWebAssetsLoader.UseStaticWebAssets(builder.Environment, builder.Configuration);

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

6.0.7

Anything else?

No response

@TanayParikh TanayParikh added the area-blazor Includes: Blazor, Razor Components label Aug 5, 2022
@javiercn
Copy link
Member

javiercn commented Aug 5, 2022

@voroninp thanks for contacting us.

We are aware of this behavior. However, we do it this way to prevent the feature from being accidentally turned on in production as it serves files from separate locations on disk other than the project.

@javiercn javiercn added question ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. labels Aug 5, 2022
@ghost ghost added the Status: Resolved label Aug 5, 2022
@voroninp
Copy link
Contributor Author

voroninp commented Aug 5, 2022

@javiercn That's fine, but it's nice to have it documented maybe?

@ghost
Copy link

ghost commented Aug 6, 2022

This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.

See our Issue Management Policies for more information.

@ghost ghost closed this as completed Aug 6, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 5, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question Status: Resolved
Projects
None yet
Development

No branches or pull requests

3 participants