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

Consider replacing WebActivatorEx.PreStart with System.Web.PreApplicationStart

daiplusplus opened this issue · comments

commented

While researching OWIN for this: #6 I saw this: https://docs.microsoft.com/en-us/dotnet/api/system.web.preapplicationstartmethodattribute?view=netframework-4.8

Phil Haack mentioned it here: https://haacked.com/archive/2010/05/16/three-hidden-extensibility-gems-in-asp-net-4.aspx/

I need to find out if it's worth ditching WebActivatorEx for this approach as it means we can remove another NuGet dependency - but is it worth it? Might some users prefer it one way or another?

From what I have found, WebActivatorEx has some extra functionality that the attributes in System.Web don't provide. From what I quickly saw in the WebActivatorEx, it handles design time stuff as well as configuration via specifically named appsettings values. And it builds on top of the built in System.Web attributes.

I also want to say that, in my experience, something didn't work right when I used the built in System.Web attributes, while WebActivatorEx worked, though I may be mistaken. If your goal is to remove the nuget dependency, make sure it works well first.

Also, if other people want to use the WebActivatorEx instead, it is something they can easily add themselves, as all they would need to do is install the nuget package directly for their project (if it isn't being pulled in by some other dependency) and include a using WebActivatorEx or prefix the attribute with WebActivatorEx.

commented

Btw @TheJayMann would you like me to add you as a member of this repo?

If you see a benefit to it, I wouldn't be against it.