danroth27 / BlazorDualMode

A Blazor app setup for server-side hosting in development and client-side hosting in production
MIT License
21 stars 5 forks source link

Consume new nuget library arrived with preview 8 #2

Open julienGrd opened 5 years ago

julienGrd commented 5 years ago

Hello daniel, and thanks for this project, i used the same skeleton for one of my project.

It seem there is a problem with preview 8, especially for reference static files (js/css) wich came with nuget package of blazor library.

How to reproduce :

Maybe there is some adaptation to do with preview 8 ?

thanks for your help !

julienGrd commented 5 years ago

I finally find what's happening,

i needed to add this line on the host configuration in the server project (program.cs) webBuilder.UseStaticWebAssets();

like this

public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseNLog(); webBuilder.UseStaticWebAssets(); webBuilder.UseStartup(); });

I keep this issue open because can be good to have this project working on the last preview