Closed Coruscate5 closed 7 months ago
This is very likely a .NET 8 RC2 bug - the env var is set to "debug" as expected for the mono src when the application loads, then somehow becomes unset during the hot reload process. Confirmed that other projects with .NET 7 and the exact same setup properly apply reload data to the running application.
It is not an RC2 bug as 8 GA is released - the fix is in the dependency ordering in Program.cs of the API. The corrected ending dependency ordering should be as follows:
app.UseHttpsRedirection();
app.UseOutputCache();
app.UseCors();
app.UseBlazorFrameworkFiles();
app.UseStaticFiles();
app.UseRouting();
app.MapRazorPages();
app.MapControllers();
app.MapFallbackToFile("index.html");
app.MapApi();
app.Run();
The location of BlazorFrameworkFiles apparently determines the "Debug" value for DOTNET_MODIFIABLE_ASSEMBLIES - in certain dependency load orders, the environment variable is reset/removed so it just reads from WASM as "null".
My copy of this project is significantly forked from trunk here, so I guess I'll just close my own issue.
Per above, closing with workaround
This issue is for a: (mark with an
x
)Minimal steps to reproduce
Any log messages given by the failure
Expected/desired behavior
OS and Version?
Versions
Mention any other details that might be useful
I cannot find any obvious way to intervene in this specific environment variable - setting it manually to Debug on either server side or client side doesn't seem to take.
There may be a way to inject into Blazor.start but I can't seem to find any docs on it.