Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Static .js in blazor class library not available in app

$
0
0

I created a BCL containing amongst other thins a js file. The file is located in the BCL in wwwroot/scripts. This js should be made available to the blazor app.

The BCL has:

<ItemGroup><Content Include="wwwroot\**\*" CopyToOutputDirectory="Always" /><EmbeddedResource Include="wwwroot\**\*" /></ItemGroup>

The consuming Blazor app:

<ItemGroup><ProjectReference Include="..\<abc>\<abc>.csproj" /></ItemGroup><PropertyGroup><StaticWebAssetBasePath>abc</StaticWebAssetBasePath></PropertyGroup>

The script is referenced in the blazor app by:

<script src="scripts/WebView2Bridge.js"></script>

also tried :

<script src="_content/<abc>/WebView2Bridge.js"></script>

In none of the cases the JS is available to the app. I checkec the bin folder of the app, and there it is after rebuild.I tried adding this to the csproj of the blazor app:

<ItemGroup><Content Update="wwwroot\scripts\Webview2Bridge.js"><CopyToOutputDirectory>Always</CopyToOutputDirectory></Content></ItemGroup>

No success.

Any suggestions ?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>