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

Static assets from razor class library not found add a razor class library to a running app #17535

Closed
danroth27 opened this issue Dec 3, 2019 · 6 comments

Comments

@danroth27
Copy link
Member

@danroth27 danroth27 commented Dec 3, 2019

Repro steps:

  • Create a standalone Blazor WebAssembly app from VS (3.1.0-preview4)
  • Run the app (Ctrl-F5)
  • Add a Razor Class Library to the project
  • Reference the RCL from the app
  • Add a link to _content/RazorClassLibrary1/styles.css to index.html
  • Add <RazorClassLibrary1.Component1 /> to Index.razor
  • Rerun the app

Expected result:

  • Component1 shows up on the home page of the app with proper styling

Actual result:

  • The styles.css files is not found.

Workaround:

  • Close and reopen the solution, rerun the app
@msftbot msftbot bot added the Needs: Triage 🔍 label Dec 3, 2019
@javiercn

This comment has been minimized.

Copy link
Member

@javiercn javiercn commented Dec 3, 2019

@danroth27 Thanks for contacting us.

This has never worked. You need to build the app for it to work so that the manifest gets regenerated.

@javiercn javiercn added the area-blazor label Dec 3, 2019
@danroth27

This comment has been minimized.

Copy link
Member Author

@danroth27 danroth27 commented Dec 3, 2019

@javiercn I did rebuild the app.

@danroth27

This comment has been minimized.

Copy link
Member Author

@danroth27 danroth27 commented Dec 3, 2019

Also, the same steps work fine with a Blazor Server app and an ASP.NET Core hosted Blazor WebAssembly app. It's only the standalone Blazor WebAssembly app that has this problem, and it only happens if I've already run the app without the RCL.

@mkArtakMSFT mkArtakMSFT added this to the blazor-wasm-preview5 milestone Dec 3, 2019
@mkArtakMSFT mkArtakMSFT added this to Triage in Blazor WASM via automation Dec 3, 2019
@mkArtakMSFT mkArtakMSFT moved this from Triage to 3.1 - Preview 5 in Blazor WASM Dec 3, 2019
@MarkStega

This comment has been minimized.

Copy link

@MarkStega MarkStega commented Dec 4, 2019

I'll chime in with exactly the same experience that Dan reported. My 'self hosted' CSB app fails to load content from a RCL component but when the same app is hosted on a DNC 3.1 site the content is loaded as expected. And the 'fix' to close and reopen the project also allows my 'self hosted' CSB to work.

@gustavnavar

This comment has been minimized.

Copy link

@gustavnavar gustavnavar commented Dec 12, 2019

I have the same issue with the Grid.Blazor compoment.

As soon as I upgrade the RCL GridBlazor to netstandard2.1 the client demo project can not find any static asset.

@javiercn

This comment has been minimized.

Copy link
Member

@javiercn javiercn commented Dec 13, 2019

This behavior is currently by design, as we don't stop and re-start the server when the app is re-built in order to provide a faster inner loop.

You can opt-out of this behavior by setting the following property explicitly in your project.

<NoRestartServerOnBuild>false</NoRestartServerOnBuild>

As per improvements to this scenario, I'm going to close this issue as there's a separate issue tracking the broader scenario #5512

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.