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

Error on publish #42

Closed
thepra opened this issue Dec 25, 2024 · 3 comments
Closed

Error on publish #42

thepra opened this issue Dec 25, 2024 · 3 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@thepra
Copy link

thepra commented Dec 25, 2024

Describe the bug

Microsoft.NET.Sdk.StaticWebAssets.Compression.targets(345,5): Error MSB4018 : errore imprevisto dell'attività "ApplyCompressionNegotiation".
System.InvalidOperationException: Endpoints not found for compressed asset: C:<redacted>\obj\Release\net9.0\compressed\4t6f7o5fzg-j538s5lvtp.gz
at Microsoft.AspNetCore.StaticWebAssets.Tasks.ApplyCompressionNegotiation.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)

After adding the package to the blazor wasm solution I get this error at publishing to a folder. In my case the call to .AddBlazorJSRuntime() is within a components library meanwhile I call .BlazorJSRunAsync() in the usual Program.cs file as usual.

To Reproduce
Steps to reproduce the behavior:

  1. Add the NuGet package to the solution
  2. Click Publish to folder
  3. See error

Expected behavior
The publishing works as usual

Desktop (please complete the following information):

  • OS: Windows 10 x64
  • Browser edge
@LostBeard LostBeard self-assigned this Dec 25, 2024
@LostBeard LostBeard added the good first issue Good for newcomers label Dec 25, 2024
@LostBeard
Copy link
Owner

Thanks for reporting your issue!

This issue has already been reported on my other repository for SpawnDev.BlazorJS.WebWorkers as issue #4 and was determined to be a bug in .Net 9.

I reported the issue to Microsoft after I determined the issue is in their code: ApplyCompressionNegotiation build task fails when RCL references a Nuget RCL with StaticWebAssetBasePath set to /

The issue was originally set to be fixed in .Net 10 but Microsoft coders have since found the source of the issue and it should be fixed in a future release of .Net 9.

@LostBeard
Copy link
Owner

LostBeard commented Dec 25, 2024

2 Possible workarounds are:

  • Use .Net 8
  • Disable compression in your app .csproj using <CompressionEnabled>false</CompressionEnabled>

See the referenced posts above for more information.

@LostBeard
Copy link
Owner

I'm going to close this because the bug is in .Net 9, and not this library.

Feel free to continue posting here if you have any related questions or comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants