gulu
gulu

Reputation: 145

Running .net application next to asp core app on IIS

I am trying to get my code to run alongside, in process, with an asp core web site. With .net framework there is an option to create a module. Then, in order to "inject" that module so that it is run when the site runs all I need to do is add the module to web.config or launch it from a .cs file from \app_code.

With asp core, there is a concept called middleware but in order to add a middleware, the user has to write it into their startup code.

I need a way to run my .net core code when the site has started (first page accessed) without requiring the user to change their code to do so. Changing config files after deploy is OK but not compiled files.

Anyone know how to do this?

Thanks.

Upvotes: 0

Views: 138

Answers (1)

Kiryl
Kiryl

Reputation: 1511

I see 2 options here:

  1. Hosting startup assemblies

An IHostingStartup (hosting startup) implementation adds enhancements to an app at startup from an external assembly. For example, an external library can use a hosting startup implementation to provide additional configuration providers or services to an app.

  1. IIS modules with ASP.NET Core - you may still be able to inject your module in case you run the app on IIS. Add a web.config manually into the root directory and configure your module in there.

Upvotes: 1

Related Questions