Hello,
I was updating to use the version 2.0.38 and have the issue below.
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 System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at ILRepacking.Steps.ModuleInitializersRepackStep.TopologicalSort(HashSet`1 assemblies) in /_/ILRepack/Steps/ModuleInitializersRepackStep.cs:line 140
at ILRepacking.Steps.ModuleInitializersRepackStep.RepackModuleInitializers() in /_/ILRepack/Steps/ModuleInitializersRepackStep.cs:line 52
at ILRepacking.ILRepack.RepackCore(String tempOutputDirectory) in /_/ILRepack/ILRepack.cs:line 434
at ILRepacking.ILRepack.Repack() in /_/ILRepack/ILRepack.cs:line 295
at ILRepacking.Application.Main(String[] args) in /_/ILRepack/Application.cs:line 50
I basically repacking all the System.Text.Json references from version 9 inside a net8 dll.
I'm auto generating the command and the result looks like this:
ILRepack.exe /allowdup /allowduplicateresources /out:IssueILRepackOut.dll IssueILRepack.dll System.IO.Pipelines.dll System.Text.Encodings.Web.dll System.Text.Json.dll runtimes\browser\lib\net8.0\System.Text.Encodings.Web.dll
The main issue is related because System.Text.Encodings.Web.dll is added two times. If I use the 2.0.37 works fine, this means 2.0.38 have some bug.
This is my csproj to reproduce the issue using the command.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Text.Json" Version="*" />
</ItemGroup>
</Project>
Hello,
I was updating to use the version
2.0.38and have the issue below.I basically repacking all the
System.Text.Jsonreferences from version 9 inside a net8 dll.I'm auto generating the command and the result looks like this:
ILRepack.exe /allowdup /allowduplicateresources /out:IssueILRepackOut.dll IssueILRepack.dll System.IO.Pipelines.dll System.Text.Encodings.Web.dll System.Text.Json.dll runtimes\browser\lib\net8.0\System.Text.Encodings.Web.dllThe main issue is related because
System.Text.Encodings.Web.dllis added two times. If I use the2.0.37works fine, this means2.0.38have some bug.This is my
csprojto reproduce the issue using the command.