MAUI 7.0.92 requires Microsoft.Extensions.Logging.Abstractions 7.0.0 while .NET 7.0.9 7.0.1
See original GitHub issueDescription
I’m not able to upgrade project using latest MAUI with .NET 7.0.9 because of Microsoft.Extensions.Logging.Abstractions conflict. Library with Microsoft Extensions.Localization requires 7.0.1 while net7.0-android and others needs 7.0.0
I’ve error: NU1605: Warning As Error: Detected package downgrade: Microsoft.Extensions.Logging.Abstractions from 7.0.1 to 7.0.0. Reference the package directly from the project to select a different version.
Steps to Reproduce
- Create MAUI Hybrid project
- Create Microsoft.NET.Sdk.Razor library with Microsoft.Extensions.Localization
- Add library reference to MAUI project
- Compile
Link to public reproduction project repository
not needed
Version with bug
Unknown/Other
Last version that worked well
7.0.49
Affected platforms
iOS, Android, Windows
Affected platform versions
.NET MAUI 7
Did you find any workaround?
no
Relevant log output
Restoring packages for C:\SCF\SCFLib\SCFLib\SCFLib.csproj...
NU1605: Warning As Error: Detected package downgrade: Microsoft.Extensions.Logging.Abstractions from 7.0.1 to 7.0.0. Reference the package directly from the project to select a different version.
SCFLib -> Microsoft.Extensions.Localization 7.0.9 -> Microsoft.Extensions.Logging.Abstractions (>= 7.0.1)
SCFLib -> Microsoft.Extensions.Logging.Abstractions (>= 7.0.0)
NU1605: Warning As Error: Detected package downgrade: Microsoft.Extensions.Logging.Abstractions from 7.0.1 to 7.0.0. Reference the package directly from the project to select a different version.
SCFLib -> Microsoft.AspNetCore.Components.Web 7.0.9 -> Microsoft.AspNetCore.Components 7.0.9 -> Microsoft.AspNetCore.Authorization 7.0.9 -> Microsoft.Extensions.Logging.Abstractions (>= 7.0.1)
SCFLib -> Microsoft.Extensions.Logging.Abstractions (>= 7.0.0)
Package restore failed. Rolling back package changes for 'SCFLib'.
Time Elapsed: 00:00:00.0982852
Issue Analytics
- State:
- Created 2 months ago
- Reactions:3
- Comments:9 (1 by maintainers)
Top Results From Across the Web
NET 7 + Servicing Milestone
NET MAUI is the . ... MAUI 7.0.92 requires Microsoft.Extensions.Logging.Abstractions 7.0.0 while .NET 7.0.9 7.0.1 area/upstream Upstream Dependencies, ...
Read more >NetMaui Blazor + RazorClass Library
I updated the package Microsoft.Extensions.Logging.Abstractions from 7.0.0 to 7.0.1. VS2022_2.png. After build, the reference to the package Microsoft.
Read more >Windows 10 .Net 6 or .Net 7 runtime getting error Could not ...
Windows 10 .Net 6 or .Net 7 runtime getting error Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=7.0.0.0.
Read more >Announcing .NET MAUI in .NET 8 Preview 7: Keyboard ...
NET MAUI is now available in .NET 8 Preview 7 introducing keyboard accelerators, and more fixes and improvements. This is the final preview ......
Read more >Package Microsoft.Extensions.Logging.Abstractions 7.0.0 ...
I'm getting the below error when I try to add any nuget package to .NET 7 applications. "Package Microsoft.Extensions.Logging.Abstractions ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had the same problem and I did
dotnet workload update
+ rebuilt the project and the problem disappearedEDIT: Ok, it did not
https://github.com/dotnet/maui/issues/12953
EDIT2: This seems to work. Put this directly into your maui .csproj
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" VersionOverride="7.0.1" />
Same issue. MAUI prevents loading a specific version (7.0.1) to force it to match. So only options appears to be to override it with
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" VersionOverride="7.0.1" />in the MAUI csproj file. Project builds with that override in place but produces error at runtime:
System.TypeLoadException: 'Could not load type of field ‘Microsoft.Extensions.Logging.LoggerFactory:_scopeProvider’ (6) due to: Could not resolve type with token 01000034 from typeref (expected class ‘Microsoft.Extensions.Logging.IExternalScopeProvider’