Can't reference static files from RCL library in WinForms BlazorWebView

Viewed 136

I am trying to use a RCL library within a WinForms BlazorWebView. The problem is that the RCL library provides some static javascript files which i try to include in the BlazorWebView. So i added the scripts to the index.html i use, with the path pointing to "_content/{lib_name}/{path_to_file}" e.g. <script src="_content/BlazorComponents/adaptivecards/adaptivecards-designer.js"></script>

The referenced files are included in the RCL library in the wwwroot folder.

BlazorComponents
-- wwwroot/
---- adaptivecards/
------ adaptivecards-designer.js

The problem i have is that somehow in the WinForms BlazorWebView these files are not there (i get the 404 in the browser control console). If i use the same RCL project in a blazor server application it works perfectly fine. It even works in a WPF BlazorWebView application.

I uploaded the example for it here: https://github.com/toba-pl/winforms-blazor

The WPF example works completly fine while in the WinForms example the javascript files are missing.

What am i doing wrong here, how can i get static files from an RCL lib into the BlazorWebView in WinForms?

I already tried adding the static files directly to project containing the BlazorWebView, but then i get the following error: Conflicting assets with the same target path... and this anyways seems more like a workaround.

Also tried the same with the WPF BlazorWebView equivalent as mentioned above, you can also check it in the linked repo, there it works completly fine.

0 Answers
Related