Update Microsoft.Extensions.DependencyInjection.Abstractions from 2.1.0 reference version to support .NET Core 3.0.0 version
hectorccmx opened this issue · 2 comments
Is your feature request related to a problem? Please describe.
No, when you compile a project with this reference and there ir a target for ASP.NET Core 3.0.0, compiler outputs a waning
"Conflicts were found between different versions of "Microsoft.Extensions.DependencyInjection.Abstractions" that could not be resolved."
Describe the solution you'd like
Update Nuget Package Reference
- Remove reference to version 2.1.0 for Microsoft.Extensions.DependencyInjection.Abstractions
- Add Framework Reference for Microsoft.AspNetCore.App
- Update TargetFrameworks from netstandard2.0 to netcoreapp3.0
Describe alternatives you've considered
None.
Additional context
Your final csproj file looks like:
<PropertyGroup>
<Description>Autofac implementation of the interfaces in Microsoft.Extensions.DependencyInjection.Abstractions, the .NET Framework dependency injection abstraction.</Description>
<VersionPrefix>5.0.1</VersionPrefix>
<TargetFrameworks>netcoreapp3.0</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>Autofac.Extensions.DependencyInjection</AssemblyName>
<AssemblyOriginatorKeyFile>../../Autofac.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<PackageId>Autofac.Extensions.DependencyInjection</PackageId>
<PackageTags>autofac;di;ioc;dependencyinjection;aspnet;aspnetcore</PackageTags>
<PackageReleaseNotes>Release notes are at https://github.com/autofac/Autofac.Extensions.DependencyInjection/releases</PackageReleaseNotes>
<PackageIconUrl>https://cloud.githubusercontent.com/assets/1156571/13684110/16b8f152-e6bf-11e5-84ae-22c66c6d351a.png</PackageIconUrl>
<PackageProjectUrl>https://autofac.org</PackageProjectUrl>
<PackageLicenseUrl>https://opensource.org/licenses/mit-license.php</PackageLicenseUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/autofac/Autofac.Extensions.DependencyInjection</RepositoryUrl>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateNeutralResourcesLanguageAttribute>false</GenerateNeutralResourcesLanguageAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<CodeAnalysisRuleSet>../../build/Analyzers.ruleset</CodeAnalysisRuleSet>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedAllSources>true</EmbedAllSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<Features>IOperation</Features>
<Authors>Autofac Contributors</Authors>
<Company>Autofac</Company>
<Product>Autofac</Product>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Autofac" Version="4.9.1" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="2.9.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19367-01" Condition="Exists('$(MSBuildThisFileDirectory)../../.git')">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Compile Update="ServiceProviderExtensionsResources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>ServiceProviderExtensionsResources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="ServiceProviderExtensionsResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>ServiceProviderExtensionsResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
Hi @hectorccmx
we purposely targeted the lowest version possible for Microsoft.Extensions.DependencyInjection.Abstractions
to keep support for older platforms as high as possible. You can resolve your problem by directly referencing Microsoft.Extensions.DependencyInjection.Abstractions
version 3.0.0
.
In general you should not see that message at all. If you provide a repository for reproduction I can figure out what's causing it. I have quite a few ASP.NET Core 3.0 applications targeting version 5.0.1
of Autofac.Extensions.DependencyInjection
Ditching support for netstandard2.0
and only adding support for netcoreapp3.0
is sadly not in option since we want to keep on supporting users running ASP.NET Core
applications on full .NET-Framework for instance.
Closing this for now. If you still need help or feel like there are problems, please feel free to open a new issue.