Thanks to visit codestin.com
Credit goes to github.com

Skip to content

CustomElements do not serve Blazor WASM files when a custom debugging environment is used. #61587

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

Closed
vsfeedback opened this issue Apr 21, 2025 · 2 comments
Labels
area-blazor Includes: Blazor, Razor Components Author: Migration Bot 🤖 The issue was created by a issue mover bot. The author may not be the actual author. ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question Status: Resolved

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


We have an old ASP.NET Core MVC project, and we would like to gradually migrate to Blazor WASM. I followed this guide.

The issue can also be tested using the code in this repository.
Everything works fine until we try to add a custom environment variable to launchsettings.json, such as "Local". I have, of course, created the corresponding appsettings. Local.json.

"IIS Express": { 
  "commandName": "IISExpress",
  "launchBrowser": true,
  "environmentVariables": {
    "ASPNETCORE_ENVIRONMENT": "Local"
  }

In this configuration, Blazor WASM files are not served during debugging. However, it works fine when using the "Development" environment.

You can try it yourself with the solution in the link above. Is this a bug, or am I doing something wrong? I tested it on .NET 8 and .NET 9.


Original Comments

Feedback Bot on 3/21/2025, 10:40 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Apr 21, 2025
@dotnet-policy-service dotnet-policy-service bot added the Author: Migration Bot 🤖 The issue was created by a issue mover bot. The author may not be the actual author. label Apr 21, 2025
@javiercn
Copy link
Member

Thanks for contacting us.

StaticWebAssets are only enabled by default during Development. If you are using a different environment, you need to wire them up manually in Program.cs. See https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/static-files?view=aspnetcore-9.0#static-files-in-non-development-environments

@javiercn javiercn added question ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. labels Apr 21, 2025
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components Author: Migration Bot 🤖 The issue was created by a issue mover bot. The author may not be the actual author. ✔️ 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

2 participants