MapStaticAssets causing exception in SDK during publish
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
### Describe the bug
Exception occurs during docker publish step when including `MapStaticAssets`. Will try to post more details later.
### To Reproduce
```
> [server 7/7] RUN dotnet publish -c Release -o out --no-restore --runtime linux-musl-x64 --self-contained true /p:PublishSingleFile=true:
2.841 /usr/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk.StaticWebAssets/targets/Microsoft.NET.Sdk.StaticWebAssets.targets(634,5): error : InvalidOperationException: Sequence contains more than one element [/app/LootGod.csproj]
2.841 /usr/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk.StaticWebAssets/targets/Microsoft.NET.Sdk.StaticWebAssets.targets(634,5): error : at System.Linq.ThrowHelper.ThrowMoreThanOneElementException() [/app/LootGod.csproj]
2.841 /usr/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk.StaticWebAssets/targets/Microsoft.NET.Sdk.StaticWebAssets.targets(634,5): error : at System.Linq.Enumerable.TryGetSingle[TSource](IEnumerable`1 source, Boolean& found) [/app/LootGod.csproj]
2.841 /usr/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk.StaticWebAssets/targets/Microsoft.NET.Sdk.StaticWebAssets.targets(634,5): error : at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source) [/app/LootGod.csproj]
2.841 /usr/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk.StaticWebAssets/targets/Microsoft.NET.Sdk.StaticWebAssets.targets(634,5): error : at Microsoft.AspNetCore.StaticWebAssets.Tasks.GenerateStaticWebAssetsDevelopmentManifest.ComputeManifestAssets(IEnumerable`1 assets)+MoveNext() [/app/LootGod.csproj]
2.841 /usr/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk.StaticWebAssets/targets/Microsoft.NET.Sdk.StaticWebAssets.targets(634,5): error : at System.Linq.Enumerable.g__EnumerableToArray|314_0[TSource](IEnumerable`1 source) [/app/LootGod.csproj]
2.841 /usr/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk.StaticWebAssets/targets/Microsoft.NET.Sdk.StaticWebAssets.targets(634,5): error : at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) [/app/LootGod.csproj]
2.841 /usr/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk.StaticWebAssets/targets/Microsoft.NET.Sdk.StaticWebAssets.targets(634,5): error : at Microsoft.AspNetCore.StaticWebAssets.Tasks.GenerateStaticWebAssetsDevelopmentManifest.ComputeDevelopmentManifest(IEnumerable`1 assets, IEnumerable`1 discoveryPatterns) [/app/LootGod.csproj]
2.841 /usr/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk.StaticWebAssets/targets/Microsoft.NET.Sdk.StaticWebAssets.targets(634,5): error : at Microsoft.AspNetCore.StaticWebAssets.Tasks.GenerateStaticWebAssetsDevelopmentManifest.Execute() [/app/LootGod.csproj]
2.841 /usr/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk.StaticWebAssets/targets/Microsoft.NET.Sdk.StaticWebAssets.targets(634,5): error : [/app/LootGod.csproj]
------
Error: failed to fetch an image or build from source: error building: failed to solve: process "/bin/sh -c dotnet publish -c Release -o out \t--no-restore \t--runtime $RUNTIME \t--self-contained true \t/p:PublishSingleFile=true" did not complete successfully: exit code: 1
```
### Exceptions (if any)
`InvalidOperationException: Sequence contains more than one element`
### Further technical details
```
.NET SDK:
Version: 9.0.100
Commit: 59db016f11
Workload version: 9.0.100-manifests.c6f19616
MSBuild version: 17.12.7+5b8665660
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.