Skip to content

Error when compiling project with NET SDK 9.0.100: No file exists for the asset at either location #41

@pacoweb

Description

@pacoweb

Installed product versions

Microsoft Visual Studio Enterprise 2022 (64-bit) - Current
Version 17.12.0
NET SDK 9.0.100
BuildBundlerMinifier2022, Version 2.9.11

Description

The new version of Visual Studio 2022 17.12.0 has removed the .NET SDK 8 and installed the NET SDK 9.0.100
After that I get an error when compiling the project
System.InvalidOperationException: No file exists for the asset at either location 'wwwroot\css\site.min.css' or 'wwwroot\css\site.min.css'.
at Microsoft.AspNetCore.StaticWebAssets.Tasks.StaticWebAsset.ComputeFingerprintAndIntegrity(String identity, String originalItemSpec)
at Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.Execute() WebApplication3 C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.targets 662

I have created an example project with only a static file to compress: site.css
This is the bundleconfig.json:

[
    {
        "outputFileName": "wwwroot/css/site.min.css",
        "inputFiles": [
            "wwwroot/css/site.css"
        ]
    }
]

The extension works correctly: https://marketplace.visualstudio.com/items?itemName=Failwyn.BundlerMinifier64

I attach a project to reproduce the error
WebErrorExample.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions