daiplusplus / AspNetDependencyInjection

`AspNetDependencyInjection` allows "Classic" ASP.NET Web Forms applications to use `Microsoft.Extensions.DependencyInjection` to compose application services using dependency injection.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MVC ArgumentNullException webObjectActivator is null

TheJayMann opened this issue · comments

When attempting to set up dependency injection using MvcApplicationDependencyInjection.ConfigureMvc, it attempts to create a DependencyInjectionWebObjectActivatorDependencyResolver passing in the value of the WebObjectActivator property from the base. However, the constructor of ApplicationDependencyInjection never sets this property, thus it is null. I would assume that either the property needs to be set in the constructor, or the property should be redefined such that it exposes the private woa value, such as protected internal DependencyInjectionWebObjectActivator WebObjectActivator => woa;

commented

This is now fixed and published in version 3.3.0.. Thank you for the issue report :)

Great. With this done, I shall continue testing this with mixed WebForms and MVC projects to make sure this works well for our other projects.

This is a weird one. I can see the changes you made to fix this in the master branch now. However, I am still getting the error after updating to 3.3 nuget packages, and, using ILSpy to look at the assemblies deployed with 3.3, it still shows the old code in it. Perhaps the deployment strategy used did not deploy with the updated code?

commented

@TheJayMann That's weird - I can confirm repro.

I've just published version 3.4.0 which I think should be correct now.