【发布时间】:2021-11-17 12:24:04
【问题描述】:
我有一个包含多个项目的应用程序/解决方案(.NET 6 - 自托管 Blazor WASM) 它可以在调试中构建和运行,没有任何问题。
现在,我尝试将其发布以在我们的一些本地服务器中进行测试,并尝试将其发布到文件夹中,并作为 .exe 运行。
问题是,当我尝试发布它时,在成功构建后的某个地方,我收到以下错误:
Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(412,5): Error : System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Microsoft.NET.Sdk.BlazorWebAssembly.ComputeBlazorPublishAssets.GroupExistingStaticWebAssets(Dictionary`2 assemblyAssets, Dictionary`2 nativeAssets, Dictionary`2 satelliteAssemblyAssets, Dictionary`2 symbolAssets, Dictionary`2 compressedRepresentations)
at Microsoft.NET.Sdk.BlazorWebAssembly.ComputeBlazorPublishAssets.Execute()
任何想法可能导致这种情况? 我正在使用 VS 2022(企业版)。
【问题讨论】:
标签: c# .net blazor publish webassembly