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.21k stars 154 forks source link

Conflict with Microsoft.AspNet.WebApi.Core v5.2.3 #202

Closed andriy-f closed 8 years ago

andriy-f commented 8 years ago

SimpleInjector.Integration.WebApi v3.1.2 conflicts with Microsoft.AspNet.WebApi.Core v5.2.3 when used in dnx project. Sample here. Removing line "Microsoft.AspNet.WebApi.Core": "5.2.3", from project.json fixes bug.

This "bug" was really obscure and hard to find. Maybe issue with Microsoft.AspNet.WebApi.Core library itself. Any ideas whi this is happening?

dotnetjunkie commented 8 years ago

The Web API integration package is designed for Web API, not for ASP.NET Core. You should use the new ASP.NET Core integration package.

andriy-f commented 8 years ago

Thing is, I use package Microsoft.AspNet.Odata which depends on WebApi2. This whole thing is inside OWIN "container". Now I want to use new features of xproj such as gulp. Btw I used standard dnx46 - NET Framework 4.6, not .NET Core. So far so good, but when trying to run this whole thing from xproj(dnx), I get inability to load SimpleInjector.Integration.WebApi when "Microsoft.AspNet.WebApi.Core" "v5.2.3" is loaded

ghost commented 8 years ago

So, I just want to confirm - since I'm not using DNX, this isn't a problem for me right?

I am about to integrate SimpleInjector with my ASP.NET 4, Web API 2 project that uses package id="Microsoft.AspNet.WebApi.Core" version="5.2.3".

I see that the SimpleInjector WebApi Integration project has package id="Microsoft.AspNet.WebApi.Core" version="4.0.20710.0".

andriy-f commented 8 years ago

No, it's not a problem

andriy-f commented 8 years ago

Since .NET Core and ASP.NET Core are released (RC2), it's good idea check if it's reproduced there. I may do it in spare time

dotnetjunkie commented 8 years ago

An RC2 compatible version of Simple Injector has just been released (v3.1.5).

andriy-f commented 8 years ago

It works. Thanks!