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

Build fails during fingerprinting with .Net 9 SDK #104

Open
kaleidocore opened this issue Nov 20, 2024 · 0 comments
Open

Build fails during fingerprinting with .Net 9 SDK #104

kaleidocore opened this issue Nov 20, 2024 · 0 comments

Comments

@kaleidocore
Copy link

kaleidocore commented Nov 20, 2024

Installed product versions

  • Visual Studio: 2022 17.12.0
  • This extension: 1.14.10

Description

(Re)build fails during fingerprinting with the new .Net 9 SDK.

Computing fingerprint and integrity for asset 'wwwroot\tlab.css'
 C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.targets(662,5): error : System.InvalidOperationException: No file exists for the asset at either location 'wwwroot\tlab.css' or 'wwwroot\tlab.css'.
 C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.targets(662,5): error :    at Microsoft.AspNetCore.StaticWebAssets.Tasks.StaticWebAsset.ComputeFingerprintAndIntegrity(String identity, String originalItemSpec)
C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.targets(662,5): error :    at Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.Execute()
Done executing task "DefineStaticWebAssets" -- FAILED.

This is the same issue as reported for TypeScript here: dotnet/aspnetcore#58948
The same solution/workaround should work for WebCompiler too, I suspect. Note that a second issue was opened specifically for the TS team here: microsoft/TypeScript#60538 and should probably be our guideline for WebCompiler too.

This problem has actually existed for a long time but would previously fail silently, i.e. the produced .css would sometimes be missing from the Publish output, but the new .Net 9 SDK Fingerprinting feature fails completely with errors.

Steps to recreate

Install VS 17.12.0 (or standalone .Net 9 SDK)
Rebuild a project with .scss -> .css compilation using the WebCompiler 2022 Plus nuget.
Note that Clean+Build generally succeeds, but Rebuild fails.
Please see the linked Github issue for more info.

Current behavior

Rebuild fails because WebCompiler generates its output too late in the build chain.

Expected behavior

Rebuild should succeeed. CSS output should be generated early enough in the build chain for fingerprinting and reliable publishing.

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

No branches or pull requests

1 participant