Skip to content

StaticWebAssets of esproj: wrong content in compressed files #50987

@pcf0

Description

@pcf0

Describe the bug

An esproj project is added as a project dependency for static assets. The assets themselves are copied as expected when published. However, the compressed files contain the content of the esproj project file itself.

As described in the technical details below, the compressed files with SDK 9.0.203 still contained the correct data.
So is it a regression or an unsupported way of using it?

To Reproduce

  1. clone https://github.com/pcf0/StaticWebAssetsBug
  2. run dotnet publish
  3. see directory StaticWebAssetsBug\bin\Release\net9.0\publish\wwwroot\
  4. app.js has the correct content of https://github.com/pcf0/StaticWebAssetsBug/blob/master/StaticWebAssetsBug.Scripts/dist/app.js
  5. app.js.gz and app.js.br have the project file as compressed content: https://github.com/pcf0/StaticWebAssetsBug/blob/master/StaticWebAssetsBug.Scripts/StaticWebAssetsBug.Scripts.esproj

Exceptions (if any)

no exception

Further technical details

details of dotnet --info

.NET SDK: Version: 10.0.100-rc.1.25451.107 Commit: 2db1f5ee2b Workload version: 10.0.100-manifests.a6e8bec0 MSBuild version: 17.15.0-preview-25451-107+2db1f5ee2

Laufzeitumgebung:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.100-rc.1.25451.107\

Installierte .NET-Workloads:
[maui-windows]
Installationsquelle: VS 17.14.36511.14, VS 18.0.11018.127
Manifestversion: 10.0.0-rc.1.25452.6/10.0.100-rc.1
Manifestpfad: C:\Program Files\dotnet\sdk-manifests\10.0.100-rc.1\microsoft.net.sdk.maui\10.0.0-rc.1.25452.6\WorkloadManifest.json
Installationstyp: Msi

[maccatalyst]
Installationsquelle: VS 17.14.36511.14, VS 18.0.11018.127
Manifestversion: 18.5.10727-net10-rc.1/10.0.100-rc.1
Manifestpfad: C:\Program Files\dotnet\sdk-manifests\10.0.100-rc.1\microsoft.net.sdk.maccatalyst\18.5.10727-net10-rc.1\WorkloadManifest.json
Installationstyp: Msi

[ios]
Installationsquelle: VS 17.14.36511.14, VS 18.0.11018.127
Manifestversion: 18.5.10727-net10-rc.1/10.0.100-rc.1
Manifestpfad: C:\Program Files\dotnet\sdk-manifests\10.0.100-rc.1\microsoft.net.sdk.ios\18.5.10727-net10-rc.1\WorkloadManifest.json
Installationstyp: Msi

[android]
Installationsquelle: VS 17.14.36511.14, VS 18.0.11018.127
Manifestversion: 36.0.0-rc.1.285/10.0.100-rc.1
Manifestpfad: C:\Program Files\dotnet\sdk-manifests\10.0.100-rc.1\microsoft.net.sdk.android\36.0.0-rc.1.285\WorkloadManifest.json
Installationstyp: Msi

Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.

Host:
Version: 10.0.0-rc.1.25451.107
Architecture: x64
Commit: 2db1f5ee2b

.NET SDKs installed:
9.0.305 [C:\Program Files\dotnet\sdk]
10.0.100-rc.1.25451.107 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.0-rc.1.25451.107 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.0-rc.1.25451.107 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.0-rc.1.25451.107 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
arm64 [C:\Program Files\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\arm64\InstallLocation]
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

The problem can be reproduced without IDE.
By testing several SDK versions, the cause of the problem was narrowed down to the change from 9.0.203 to 9.0.300.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-AspNetCoreRazorSDK, BlazorWebAssemblySDK, dotnet-watchuntriagedRequest triage from a team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions