Skip to content

Add example for the new ASP.NET Core 6.0 "startup-less" configuration to ASP.NET Core MVC Integration NuGet package integration docs #132

@greyseal96

Description

@greyseal96

I am just starting to work with a new project that is using ASP.NET Core 6.0 and I noticed that the startup class is now not the "standard" way of setting up the application. I went to the Simple Injector documentation to try to find how to integrate Simple Injector with the application and I had trouble figuring out:

  • which integration package to use
  • how to integrate with the new "startup-less" configuration

After searching online for a while I eventually found this issue comment on the Simple Injector repo which lists an example of how to do the Simple Injector integration in the "startup-less" way. It would be really helpful to have an example of this way on the ASP.NET Core MVC Integration page as well. I found this commit in the Documentation repo where it looks like a change was made to update the documentation to be compatible with .NET 6 but it was just a small addition to the existing example which shows how to do the bootstrapping in a Startup class. It would be really helpful to have a separate example that shows how to do the integration in the "new way". I would be happy to submit a PR with the change, if that helps. I'll just take the example that Steven posted and add it as an example.

One other request... This is sort of related to this issue, as I mentioned above, but it might be its own separate issue. If it is, let me know and I'll open another issue. I know that ASP.NET and ASP.NET Core have changed their names of things a lot which has made things difficult to keep track of in the documentation. But I had some trouble figuring out which integration package to use. With the dotnet SDK, there are several templates which can be used. It's really hard to know which one of those templates maps to which Simple Injector integration package. For example, in this particular instance, I used the "webapi" template (ASP.NET Core Web API). In the documentation there is a page in the Integration Guide for ASP.NET Web API but it looks like it pertains to the "old" ASP.NET. It would be really helpful if there were some additional guidance or verbiage to help indicate which integration package to use. For example, I just took my best guess that the page for ASP.NET Core and ASP.NET Core MVC was the page I should use but it's really hard to know for sure based on the page names and the integration package names. For example, it's not super clear that the SimpleInjector.Integration.AspNetCore.Mvc.Core package is the correct package to use for integrating with something started from the "webapi" template, especially when there's a separate template in the dotnet SDK named "mvc". Adding to my confusion was that the page in the documentation guide is named something like "ASP.NET Core and ASP.NET Core MVC". There is no mention in the page that this includes ASP.NET Core Web API as well. I realize that a lot of this is due to Microsoft's changing product naming but perhaps there's something that the documentation can do to help out in this regard?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions