-
-
Notifications
You must be signed in to change notification settings - Fork 772
[Bug]: Wrong version of Microsoft.Extensions.DependencyInjection in NuGet #6541
Copy link
Copy link
Closed
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues
What happened?
DotNetNuke.DependencyInjection has a wrong version of the dependency Microsoft.Extensions.DependencyInjection.
Steps to reproduce?
- Create a new .NET Standard/Core project.
- Change the .csproj to:
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net48</TargetFramework> <LangVersion>latest</LangVersion> </PropertyGroup> <ItemGroup> <PackageReference Include="DotNetNuke.DependencyInjection" Version="10.0.0" /> </ItemGroup> </Project>
- Build the project.
Current Behavior
A warning gets displayed:
Microsoft.Common.CurrentVersion.targets(2424,5): Warning MSB3277 : Found conflicts between different versions of "Microsoft.Extensions.DependencyInjection.Abstractions" that could not be resolved.
There was a conflict between "Microsoft.Extensions.DependencyInjection.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" and "Microsoft.Extensions.DependencyInjection.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60".
Expected Behavior
No warning/mismatch of versions from Microsoft.Extensions.DependencyInjection
Anything else?
I think this is because in the nuspec, version 7.0 is declared:
| <dependency id="Microsoft.Extensions.DependencyInjection" version="7.0.0" /> |
But in the actual library/csproj, version 8.0 is declared:
Dnn.Platform/DNN Platform/DotNetNuke.DependencyInjection/DotNetNuke.DependencyInjection.csproj
Line 18 in db46a7d
| <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" /> |
Workaround
A workaround is adding Microsoft.Extensions.DependencyInjection manually to the .csproj of your library (created in step 2):
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
</ItemGroup>Affected Versions
10.0.0 (latest v10 release)
What browsers are you seeing the problem on?
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable