Is there an existing issue for this?
Describe the bug
I have a Blazor project that I'm trying to upgrade from net8 to net10.
It was all working in net8, but in net10 I now get this error on building the Blazor app.
C:\Program Files\dotnet\sdk\10.0.102\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.ScopedCss.targets(397,3): error MSB4018:
The "FilterStaticWebAssetEndpoints" task failed unexpectedly.
System.ArgumentException: An item with the same key has already been added. Key: C:\Work\blah\Whatever.Web.Client\obj\Debug\net10.0\scopedcss\projectbundle\Whatever.Web.Client.bundle.scp.css
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at Microsoft.AspNetCore.StaticWebAssets.Tasks.StaticWebAsset.ToAssetDictionary(ITaskItem[] candidateAssets, Boolean validate)
at Microsoft.AspNetCore.StaticWebAssets.Tasks.FilterStaticWebAssetEndpoints.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExe
cutionMode howToExecuteTask)
I thought that this was something to do with having my API controllers in a different project and copying the generated swagger file about, but this seems to be something to do with CSS.
Any ideas what's going on? Is it fixable? Do I need to stop on net8?
Expected Behavior
No response
Steps To Reproduce
No response
Exceptions (if any)
System.ArgumentException: An item with the same key has already been added.
.NET Version
10.0.102
Anything else?
> dotnet --info
.NET SDK:
Version: 10.0.102
Commit: 4452502459
Workload version: 10.0.100-manifests.6d969a7e
MSBuild version: 18.0.7+445250245
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.102\
.NET workloads installed:
[android]
Installation Source: VS 18.2.11415.280, VS 17.14.36717.8
Manifest Version: 36.1.2/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.android\36.1.2\WorkloadManifest.json
Install Type: Msi
[maui-windows]
Installation Source: VS 18.2.11415.280, VS 17.14.36717.8
Manifest Version: 10.0.1/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.maui\10.0.1\WorkloadManifest.json
Install Type: Msi
[maccatalyst]
Installation Source: VS 18.2.11415.280, VS 17.14.36717.8
Manifest Version: 26.1.10502/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.maccatalyst\26.1.10502\WorkloadManifest.json
Install Type: Msi
[ios]
Installation Source: VS 18.2.11415.280, VS 17.14.36717.8
Manifest Version: 26.1.10502/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.ios\26.1.10502\WorkloadManifest.json
Install Type: 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.2
Architecture: x64
Commit: 4452502459
.NET SDKs installed:
9.0.308 [C:\Program Files\dotnet\sdk]
10.0.102 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.23 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
DOTNET_CLI_UI_LANGUAGE [en-US]
DOTNET_GCHeapCount [2]
DOTNET_GCNoAffinitize [1]
DOTNET_MULTILEVEL_LOOKUP [0]
DOTNET_TC_CallCountThreshold [1000]
DOTNET_ThreadPool_UnfairSemaphoreSpinLimit [0]
DOTNET_gcConcurrent [0]
Detected COMPlus_* environment variable(s). Consider transitioning to DOTNET_* equivalent.
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Is there an existing issue for this?
Describe the bug
I have a Blazor project that I'm trying to upgrade from net8 to net10.
It was all working in net8, but in net10 I now get this error on building the Blazor app.
I thought that this was something to do with having my API controllers in a different project and copying the generated swagger file about, but this seems to be something to do with CSS.
Any ideas what's going on? Is it fixable? Do I need to stop on net8?
Expected Behavior
No response
Steps To Reproduce
No response
Exceptions (if any)
System.ArgumentException: An item with the same key has already been added.
.NET Version
10.0.102
Anything else?