How do I fix static assets not showing on implementing project with .Net9
Hi, I am having an issue in my app when trying to implement a Nuget package.
My project has the following configuration:
<ItemGroup>
<!-- Include the JavaScript file in the NuGet package -->
<Content Include="wwwroot\**\*">
<Pack>true</Pack>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Microsoft.JSInterop" Version="9.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
and it shows properly in my project:
But when I access the file I get a blank page:
if I try the compressed version I can see the code:
The _content url does not work:
//the nuspec file shows:
<contentFiles>
<files include="any/net9.0/wwwroot/scripts/invokegooglecaptcha.js" buildAction="Content" />
</contentFiles>
I reference the file like this:
<script src="@Assets["/scripts/invokegooglecaptcha.js"]" type="text/javascript"></script>
I searched through the documentation but I could not resolve it. Any help is appreciated it. Thank you.