0

I have a solution with several ASP.NET Web Api projects using .Net core 2.
I added a new .net core 3.1 project to this solution, the new project has a hosted service in it, so the app needs to run even if no requset was made to the server.

After trying to deploy my new projcet on IIS (and configuring it as described in this question), I noticed the service does not start(there's an info message I log at the start of the main function to make sure the appliction started).
Going back to Visual studio, I put a breakpoint in the main function on my project and saw that the breakpoint won't hit unlass a requst is made to the application.

At this point I tried to chage the hosting model to "Out Of Process" but this beaviour presisted.
A breakpoint I put in the main function of one of the .Net core 2 projects does hit, even without a requast.

I started both projects using IIS express, both of them are set not to launch a browser when they start, and I cant find any other diffrance in the settings of the two projcts aside from the .net core version they compile to.

Can anyone explain this change in beaviour and how to get around it?

  • 1
    Depending on your project settings, VS might send an initial request to IIS Express while launching your web app. Thus, you cannot draw any conclusion on VS/IIS Express and expect that to apply to full IIS. – Lex Li Jan 31 '21 at 18:16
  • What is your .net core 3.1 project for? Do you mean it can run in VS but not in IIS? – Ding Peng Feb 01 '21 at 07:59

1 Answers1

0

It took me an embarrassing amout of time but I managed to solve the issue. under "debug" tab in the project settings there is are two combo boxes:

  • profile
  • launch

both where needed to be set to "IIS Express" for the appliction to start without a requset being made.
As was written to me in the comments, this did not solve my issue with running my appliction on full IIS, the issue there turned out to be missing the "handler" tag in the web.config file