I have a problem similar to the one outlined in this question.
When using custom environments while running locally, some files are not being loading (resulting in 404s, etc).
Question: How can I call .UseStaticWebAssets()
using the WebApplicationBuilder
?
In my program.cs, I tried adding some code to call .UseStaticWebAssets()
like below, but I'm seeing the error ConfigureWebHost() is not supported by WebApplicationBuilder.Host. Use the WebApplication returned by WebApplicationBuilder.Build() instead
.
// program.cs
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
builder.Host.ConfigureWebHostDefaults(builder =>
{
builder.UseStaticWebAssets();
});
// etc...
}
If I try using the WebHost
prop on the aforementioned builder, I see compiler errors when trying to call the UseStaticWebAssets()
method.