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

Unable to build project using VS 17.12.3: “DiscoverPrecompressedAssets” task failed unexpectedly #59625

Open
1 task done
fltrierweiler opened this issue Dec 23, 2024 · 1 comment
Labels
area-blazor Includes: Blazor, Razor Components

Comments

@fltrierweiler
Copy link

fltrierweiler commented Dec 23, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I've found a similar issue, but the exception there isn't the same (System.ArgumentException there and System.InvalidOperationException here) and that issue was closed without an answer, so I've decided to create a new one.

Basically, I'm unable to build an existing project that uses Blazor.BrowserExtension.Template. It used to work fine with version 17.11.35219.272.

Expected Behavior

Simply put, the project build should work without errors, as it used to do.

Steps To Reproduce

I've created a minimalistic project to showcase the issue. To reproduce the error, all that has to be done is to build the project.

Exceptions (if any)

Here's the error I get whenever I try to build the project using VS 17.12.3:

The "DiscoverPrecompressedAssets" task failed unexpectedly.
System.InvalidOperationException: Fingerprint for '...\ExtensionTest\ExtensionTest\obj\Debug\net8.0\browserextension\build\BackgroundWorker.js' is not defined.
   at Microsoft.AspNetCore.StaticWebAssets.Tasks.StaticWebAsset.Validate()
   at Microsoft.AspNetCore.StaticWebAssets.Tasks.StaticWebAsset.FromTaskItem(ITaskItem item)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Microsoft.AspNetCore.StaticWebAssets.Tasks.DiscoverPrecompressedAssets.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

.NET Version

9.0.101

Anything else?

UPDATE: If I use SDK 8.0.404 and specify the version by adding a global.json to the solution folder, it actually works. Still no way to work with 9.0.101, though.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Dec 23, 2024
@MarcoMedrano
Copy link

MarcoMedrano commented Dec 24, 2024

I have the same issue building my maui app, your workaround is working (as I did not update my projects to dotnet 9):

global.json at root directory:

{
  "sdk": {
    "version": "8.0.206"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

No branches or pull requests

2 participants