Mono.Cecil.ResolutionException: Failed to resolve System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes
at Mono.Cecil.Mixin.CheckedResolve(TypeReference self)
at Mono.Cecil.MetadataBuilder.GetConstantType(TypeReference constant_type, Object constant)
at Mono.Cecil.MetadataBuilder.AddConstant(IConstantProvider owner, TypeReference type)
at Mono.Cecil.MetadataBuilder.AddField(FieldDefinition field)
at Mono.Cecil.MetadataBuilder.AddFields(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddTypeDefs()
at Mono.Cecil.MetadataBuilder.BuildTypes()
at Mono.Cecil.MetadataBuilder.BuildModule()
at Mono.Cecil.ModuleWriter.BuildMetadata(ModuleDefinition module, MetadataBuilder metadata)
at Mono.Cecil.ModuleWriter.WriteModuleTo(ModuleDefinition module, Stream stream, WriterParameters parameters)
at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters)
at ILRepacking.ILRepack.Repack()
at ILRepacking.Application.Main(String[] args)
Please find attached simple project to reproduce it. ILRepack and all libraries can be found in bin/Release/net6.0 Protobuf and ILRepack have last versions.
I try to merge libraries into one file using ILRepack
ILRepack.exe /union /out:repack.dll"ProbufRepack.dll" "System.Collections.Immutable.dll" "protobuf-net.Core.dll" "protobuf-net.dll"
And get the following error:
Please find attached simple project to reproduce it. ILRepack and all libraries can be found in bin/Release/net6.0 Protobuf and ILRepack have last versions.
ProbufRepack.zip
I also tried to download sources of Probuf-net.Core, I've found this types, but was not able to change this behavior.
Please also check the protobuf sources: https://github.com/protobuf-net/protobuf-net/blob/main/src/protobuf-net.Core/Internal/DynamicallyAccessedMembersAttribute.cs. Protobuf hasn't nuget dependency with these types.
Thank you in advance.