simpleinjector / SimpleInjector

An easy, flexible, and fast Dependency Injection library that promotes best practice to steer developers towards the pit of success.
https://simpleinjector.org
MIT License
1.22k stars 152 forks source link

SimpleInjector.Integration.WebApi for .NET 6 #931

Closed smarteez17 closed 2 years ago

smarteez17 commented 3 years ago

Hi there

for API I normally install SimpleInjector.Integration.WebApi and SimpleInjector but now SimpleInjector.Integration.WebApi is giving this error Package 'Microsoft.AspNet.WebApi.Client 4.0.20710' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework 'net6.0'. This package may not be fully compatible with your project.

What should I used

dotnetjunkie commented 3 years ago

I'm not sure that ASP.NET Web API even runs on .NET 6, so this might not be an issue with the Simple Injector packages. Migrating your Web API project to .NET 6 might require migrating to the ASP.NET Core platform as well. You might want to check this first.