-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal error in IL Linker:Failed to resolve Microsoft.Extensions.Logging.Abstractions.Internal.NullScope #16063
Comments
The 10651 referred to is the issue in the aspnet/AspNetCore repo, not mono's. |
After some more playing around, adding the following to the Blazor Client project results in a successful compilation, although obviously a much larger publish size.
Also, might it be related to this? |
Issue still exists in preview 8. And interestingly, on preview 8 the |
Wasm error output in Chrome console:
|
I am getting the same error. What can I do about it? |
Still refuses to compile the Client project under preview 9 without referencing Microsoft.Extensions.Logging in the csproj file. Wasm error seems to be gone now. |
Still exists on rc1... (Using updated preview9 blazor packages per rc1 release notes) |
Is this still a valid issue using the current Blazor preview? |
This is also valid when consumed in a Xamarin Android project. Running latest VS for mac preview:
Stack trace of error:
|
Is anyone looking into this? |
This seems to be caused by mismatching assemblies, i.e. Microsoft.Extensions.Logging.dll but the Microsoft.Extensions.Logging.Abstractions assembly doesn't have a type named So this doesn't seem to be a mono/linker issue, the linker fails because it tries to read all the assemblies and resolve all the references. |
@vargaz thank you for your reply. I will investigate on my end, you are most likely right that some library is pulling in an older version or something. Although I would have never gathered that from this error. |
So this happened to me out of the blue...Anything I can do? Is this being looked at? Is this even a bug? |
It happens because mismatching assemblies are being passed to the linker. |
How would I troubleshoot that? It happened seemingly out of the blue. |
Its a problem with the build system/IDE/nuget etc. Its not a mono bug. |
I fixed it by ensuring that every library I consumed was on the same major version of the Microsoft.Extensions.Logging.Abstractions package. Had a dependency on Serilog.Extensions.Logging which pulled in an old version of Microsoft.Extensions.Logging in and in turn grabbed and old version of the Abstractions package. Since we have no way of checking transitive packages easily with Xamarin projects it is a bit of a cumbersome task to do. But perhaps check your log from restoring packages and see if there are any downgrades there. |
Possibly related to dotnet/linker#858 |
This problem also occurs when using Microsft.Bot.Connector.DirectLine 3.0.3-Preview1 (references Microsoft.Extensions.Logging 2.1.1 via Microsoft.Bot.StreamingExtensions 4.5.0-preview1) (in one project) with Microsoft.Extensions.Caching.Memory 3.1.7 (references Microsoft.Extensions.Logging.Abstractions 3.1.7) (in a different project) , specifically for Android projects built using an AzureDevOps pipeline. We see the exception, presumably because of the same mismatch, however this builds and runs successfully when built on Visual Studio (Windows or Mac), so it can be surmised that the VS build system successfully handles the mismatch (or at least handles the exception gracefully), whereas the build system used by the AzDevOps pipeline does not, however maybe Microsoft.Extensions.Logging 3.1.7 is being cached by VS. |
I am having the exact same issue using JetBrains Rider so I guess only Visual Studio knows how to [gracefully] handle this. |
It is a problem related to different versions used of
To troubleshoot this, you need to look at the |
I just had this happen on a Xamarin.Forms iOS iPhone Release build. Manage Nugets / Install / Microsoft.Extensions.Logging 6.0.0 did eliminate that exception. (I didn't uninstall/reinstall any other nugets). NOTE: The build crashes when launched (ONLY on iPhone Release), so its possible adding that Logging Nuget version was not sufficient. |
From @ar0311 on Monday, August 5, 2019 9:47:44 PM
Describe the bug
Possibly related to #10651
When compiling a Blazor Client app in a Hosted Blazor solution with references to Identity in the Shared project, compilation fails. In my case, using RavenDB.Identity in the Shared project (referenced by the Client project) pulls in the Identity references.
Manually adding a PackageReference in the Client project csproj to Microsoft.Extensions.Logging results in successful compilation
To Reproduce
Steps to reproduce the behavior:
Example:
Fatal error in IL Linker
Unhandled exception. Mono.Linker.MarkException: Error processing method: 'System.IDisposable Microsoft.Extensions.Logging.Logger::BeginScope(TState)' in assembly: 'Microsoft.Extensions.Logging.dll'
---> Mono.Cecil.ResolutionException: Failed to resolve Microsoft.Extensions.Logging.Abstractions.Internal.NullScope Microsoft.Extensions.Logging.Abstractions.Internal.NullScope::get_Instance()
at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
Expected behavior
Successful compilation.
Copied from original issue: dotnet/aspnetcore#12894
The text was updated successfully, but these errors were encountered: