arex388 / Arex388.AspNet.Mvc.Startup

ASP.NET MVC "classic" dependency injection and service configuration extensions to simulate ASP.NET Core's Startup configuration
MIT License
8 stars 3 forks source link

Scope Creep #1

Closed dahlbyk closed 1 month ago

dahlbyk commented 4 years ago

As I imagine thousands of projects will be over the coming years, I'm embarking upon an incremental migration of a classic ASP.NET MVC/WebAPI project to ASP.NET Core. I stumbled on this project via https://gist.github.com/davidfowl/563a602936426a18f67cd77088574e61, in search of scoped dependency support for my naïve implementation of IDependencyResolver for Microsoft.Extensions.DependencyInjection.

I stopped by to check if you'd be interested in expanding the scope of this project a bit to make migration easier in more scenarios, e.g.

Ultimately my goal is an in-place migration instead of side-by-side, and I'm interested in helping ease that pain for others while I'm at it. If you're at all interested, I'd be glad to help. If you're not, I'd love to use what you have so far as a starting point. (This project does not currently have an license.)

arex388 commented 4 years ago

Hey @dahlbyk, sorry for the delayed reply. I'm open to any suggestions you have to make this project more versatile and helpful to other developers in the same boat you and I are in. Unfortunately, I work two full time jobs and my time to contribute is very limited... As for the licensing, I never really understood what license to pick so I just left it blank.

On a side note, I'm curious how you plan to do your in-place conversion? My app implements vertical slices, so I was planning on separating those out into a standalone library, and then have the existing .NET Framework app and a new .NET Core app to switch to later on. Haven't gotten that for yet though...

By the way, what was the conclusion to the Hangfire issue you opened? I read through it and saw that you closed it, but I wasn't clear on what the conclusion was, or I missed it.

Thanks for offering to contribute by the way!

dahlbyk commented 4 years ago

Hey @dahlbyk, sorry for the delayed reply.

Never apologize for "delays" on free work. 😀

I'm open to any suggestions you have to make this project more versatile and helpful to other developers in the same boat you and I are in. Unfortunately, I work two full time jobs and my time to contribute is very limited...

Understood. You deserve credit for getting this started, but if your circumstances don't lend to taking the lead that's fine. To that end, I might make an Organization to host whatever this project turns into? Thoughts on a name other than yours?

As for the licensing, I never really understood what license to pick so I just left it blank.

I'm not a lawyer, let alone your lawyer, so don't consider this legal advice, but https://choosealicense.com/ does a good job of describing your options. I personally use MIT, as does .NET Core; ASP.NET uses Apache. A reciprocal license like GPL might discourage folks from using the project.

On a side note, I'm curious how you plan to do your in-place conversion? My app implements vertical slices, so I was planning on separating those out into a standalone library, and then have the existing .NET Framework app and a new .NET Core app to switch to later on. Haven't gotten that for yet though...

I'm still working on exactly what the plan is there. For now I've converted the project in-place in a separate git worktree and am chipping away at the build errors I encounter.

By the way, what was the conclusion to the Hangfire issue you opened? I read through it and saw that you closed it, but I wasn't clear on what the conclusion was, or I missed it.

If you take a dependency on Hangfire.NetCore instead of Hangfire.AspNetCore you can avoid extra dependencies beyond the Microsoft abstractions.

Thanks for offering to contribute by the way!

A blessing and a curse. 😎

davidfowl commented 4 years ago

I'll happily lend my expertise. Let me know if you need advice or a code review

dahlbyk commented 4 years ago

I'll happily lend my expertise. Let me know if you need advice or a code review

Appreciate that, @davidfowl. Would you mind expanding a bit on:

it might be interesting to go further and look at what it means to run the generic host in a classic ASP.NET application as well. That way you get configuration, logging and DI.

I see a few different layers of abstractions, but I'm not sure what you mean by "run the generic host":

dahlbyk commented 4 years ago

I see a few different layers of abstractions, but I'm not sure what you mean by "run the generic host":

I suppose you might literally mean run GenericHost from Microsoft.AspNetCore.Hosting, which depends on Microsoft.AspNetCore.Http (src). 🤔

davidfowl commented 4 years ago

I think it depends on what the goal is. I think its possible to adopt Microsoft.Extensions.Hosting.Abstractions and the DI container (ConfigureServices). You could also make IWebHostEnvironment work but I'm not sure about adapting the Http* layer.

dahlbyk commented 1 month ago

I semi-forked this as https://github.com/dahlbyk/Unravel:

Unravel.Startup (NuGet) provides a fully configurable ASP.NET Core IWebHost on top of System.Web via OWIN, with forward-compatible dependency injection, configuration and logging.

arex388 commented 1 month ago

@dahlbyk that's really cool, and quite a hefty undertaking! You're going to be busy... 😅