Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

747
Views
Error in publishing solution to a folder - Self hosted .NET

I have an app/solution with multiple projects inside (.NET 6 - self-hosted Blazor WASM) It can build and run in debugging without any issues.

Now, i tried to publish it for testing in some of our local servers, and i try to publish it to a folder, and run as an .exe.

Problem is, when i try to publish it, somewhere after building succesfully, i receive the following error :

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()

Any ideas what could cause this ? I am using VS 2022 (Enterprise).

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

This error seems a lot like an open issue #37610 - Blazor AOT compilation fails at ComputeBlazorPublishAssets.GroupExistingStaticWebAssets

Here are the steps to further diagnose the problem:

You can capture a binary log with dotnet publish /bl and use MSBuild structured log viewer to look at the ComputeBlazorPublishAssets task. Within there, if you expand the parameters, it'll show all the ExistingAssets and you can get a better idea of what's happening. (You'll see the duplicated asset)

You can download MSBuild structured log viewer from here: https://msbuildlog.com/

over 4 years ago · Santiago Trujillo Report

0

I recommend you don't try to learn Blazor; it has too many problems, and when you try to update your project, you'll run into errors like the ones below that you won't be able to solve, not even with artificial intelligence. That's when you'll realize you wasted your time and that it would have been better to use Angular and Laravel. If you don't believe me, ask anyone if Blazor has more problems than other technologies. MONO_WASM: instantiate_wasm_module() failed LinkError: WebAssembly.instantiate(): Import #38 "env" "mono_wasm_debugger_log": function import requires a callable

dt @ dotnet.runtime.js:3

dotnet.js:3 MONO_WASM: LinkError: WebAssembly.instantiate(): Import #38 "env" "mono_wasm_debugger_log": function import requires a callable

d @ dotnet.js:3

blazor.web.js:1 Error in mono_download_assets: LinkError: WebAssembly.instantiate(): Import #38 "env" "mono_wasm_debugger_log": function import requires a callable

Ar @ blazor.web.js:1

4dotnet.js:3 Uncaught (in promise) LinkError: WebAssembly.instantiate(): Import #38 "env" "mono_wasm_debugger_log": function import requires a callable

dotnet.runtime.js:3 Uncaught (in promise) LinkError: WebAssembly.instantiate(): Import #38 "env" "mono_wasm_debugger_log": function import requires a callable

2(index):1 Uncaught (in promise) LinkError: WebAssembly.instantiate(): Import #38 "env" "mono_wasm_debugger_log": function import requires a callable

blazor.web.js:1 Uncaught (in promise) Error: Failed to start platform. Reason: LinkError: WebAssembly.instantiate(): Import #38 "env" "mono_wasm_debugger_log": function import requires a callable

at you (blazor.web.js:1:163721)

blazor.web.js:1 Uncaught (in promise) LinkError: WebAssembly.instantiate(): Import #38 "env" "mono_wasm_debugger_log": function import requires a callable

9 months ago · Jorge arana neyra Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!