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

Bug: starup error when My ASPNETCORE_ENVIRONMENT is not setting to Development #44

Closed
dengyakui opened this issue Oct 28, 2021 · 3 comments · Fixed by #133
Closed

Bug: starup error when My ASPNETCORE_ENVIRONMENT is not setting to Development #44

dengyakui opened this issue Oct 28, 2021 · 3 comments · Fixed by #133
Labels
bug Something isn't working

Comments

@dengyakui
Copy link

Bug desc

In our project, we have multi environment configs, each of them has a appsettings file.for example:

  • appsettings.json (common config info for all env)
  • appsettings.2020test.json ( some special configs for 2020test env)
  • appsettings.2020prod.json ( some special configs for 2020prod env)

When I change the default ASPNETCORE_ENVIRONMENT to custom name, like "2020test" the MudBlazor got some error after start the project.
image

My Configs

os: win11
IDE: VS2022 Version 17.0.0 Preview 4.1
local dotnet version : 5.0 latest /6.0 RC2
local MudBlazor version: 5.1.5 + lastest rc

image


How to reproduce

  1. Create a startup Blazor Server project using the MudBlazor template
    image

  2. Open the launch setting file, change the env name from Development to a custome env
    image

  3. Start the server project, when the browser launch, the UI is a crazy large icon!
    image

some static file was 404 when start not as a dev environment.
image

@JonBunator
Copy link
Member

You need to include:
webBuilder.UseStaticWebAssets();
in your program.cs. Then it should work

@JonBunator
Copy link
Member

We should also add this to the templates

@psijkof
Copy link
Contributor

psijkof commented Apr 26, 2022

The PR was closed, but this issue persists.
Also for WASM when hosted.

PR created:

#133

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants