Daddoon / BlazorMobile

Create full C# driven hybrid-apps for iOS, Android, UWP & Desktop with Blazor!
MIT License
413 stars 55 forks source link

Razor class library static assests #160

Closed nightBaker closed 4 years ago

nightBaker commented 4 years ago

I use blazor components from different razor class libraries which allow to include static assets. For example, i use <link href="_content/MY.LIB/styles.css" rel="stylesheet" /> in my blazor client app index.html.

The problem is MY.LIB assets are not coppied to target blazor zip. I can see only wwwroot assests there.

Daddoon commented 4 years ago

Hi,

It’s maybe a scenario not yet managed by the tool, as I focused to make it work without having to do full publishing wich I think would have included the files.

Do you have a minimal project repro with your Razor Class library to attach somewhere ? This way I may work on this in some time coming.

Otherwise if you want to workaround before I publish a fix, it would be to add a custom pre-build event on your Blazor project that copy the reference from your source package to your wwwroot output. If it’s not possible for you, then send me a repro , I will try to fix this shortly.

Regards

Daddoon commented 4 years ago

I did some test and i get the issue.

Actually if we want to have the correct format for RCL use, the Blazor app must be published, in order to embed the _content files as expected for production.

In Development / Debugging session, static assets are only managed by using some kind of custom configuration in Visual Studio in order to prevent publishing at each build.

I have to dig in the build process to fix that.

Daddoon commented 4 years ago

This issue should now be fixed in some dev branches. You will have to wait that i release a new version to use it from the regular NuGet repository.

If you are in hurry you can try to build yourself the packages from even dev_blazormobile_3.2.1-preview1.20073.1 branch or dev_blazormobile_3.2.1-preview1.20073.1_fix_160_RCL_Support OR alternatively, you can download the attached NuGet package here:

BlazorMobile.Build.3.2.1-preview1.20073.1.zip

...and try to install it manually.

Otherwise, i think i will ship an update in some days (i wish)

Daddoon commented 4 years ago

Hi @nightBaker !

The update with the fix has been released ! Please update to the last version of BlazorMobile.