Closed dazinator closed 5 years ago
I did, but i noticed one of my dependencies still references a preview-6 blazor depedendency. Would this cause the linker to bomb out?
I think that also happened to me, because some references where preview-6. Try upgrading everything.
@dazinator yes it might because ILLinker will try to find what is useless in your project binaries so If it finds something referencing (in your project or in a dependency) "System.Text.Json.Serialization.JsonSerializerOptions" it'll try to find it. In this case this class moved a namespace upper in "System.Text.Json". It could also be because of an other dependency. If you still want to execute your project, you can disable the linker by following this doc https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/blazor/configure-linker?view=aspnetcore-3.0
But you might have this error at runtime anyway.
@dazinator please confirm this is an issue after you'll resolve all your references to point to Preview7.
Ok. I'll have to wait until downstream dependencies are republished to nuget until I can retest this in my application.
Ran into same issue, updated all dependencies (and sub-sub-... -dependencies) to Preview-7 and IL Linker worked again!
I saw a similar issue today. This was caused by some custom nuget dependencies that were not compiled as the correct target framework, e.g. one .NetStandard project referencing NetFramework:
5>Processing embedded resource linker descriptor: mscorlib.xml
5>Duplicate preserve in resource mscorlib.xml in mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e of System.Threading.WasmRuntime (All). Duplicate uses (All)
5>Type System.Reflection.Assembly has no fields to preserve
5>Fatal error in IL Linker
5>Unhandled exception. Mono.Cecil.ResolutionException: Failed to resolve System.IO.Ports.SerialPort
5> at Mono.Linker.Steps.MarkStep.HandleUnresolvedType(TypeReference reference)
5> at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
5> at Mono.Linker.Steps.MarkStep.MarkField(FieldReference reference)
5> at Mono.Linker.Steps.MarkStep.InitializeFields(TypeDefinition type)
5> at Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type)
5> at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)
5> at Mono.Linker.Steps.MarkStep.Initialize()
5> at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
5> at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
5> at Mono.Linker.Pipeline.Process(LinkContext context)
5> at Mono.Linker.Driver.Run(ILogger customLogger)
5> at Mono.Linker.Driver.Execute(String[] args, ILogger customLogger)
5> at Mono.Linker.Driver.Main(String[] args)
Closing this as this doesn't seem to be an issue with Blazor.
Having updated my Blazor client solution from preview 6 to preview 7 followed this guidance doing a
dotnet build
results in the following linker error where it is unable to findSystem.Text.Json.Serialization.JsonSerializerOptions
:Notes: