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

Consume new nuget library arrived with preview 8 #2

Open
julienGrd opened this issue Aug 21, 2019 · 1 comment
Open

Consume new nuget library arrived with preview 8 #2

julienGrd opened this issue Aug 21, 2019 · 1 comment

Comments

@julienGrd
Copy link

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 :

<link href="_content/Blazor.ContextMenu/blazorContextMenu.min.css" rel="stylesheet" />
<script src="_content/Blazor.ContextMenu/blazorContextMenu.min.js"></script>
  • launch the project in development (server side) => everything is OK, i see the two static file loaded
  • launch the project in Production (client side) : 404 on both the js and css file.

Maybe there is some adaptation to do with preview 8 ?

thanks for your help !

@julienGrd
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant