Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANCM: IISExpress and switching hostingModel #5599

Closed
shirhatti opened this issue Mar 5, 2018 · 14 comments
Closed

ANCM: IISExpress and switching hostingModel #5599

shirhatti opened this issue Mar 5, 2018 · 14 comments
Assignees
Labels

Comments

@shirhatti
Copy link
Contributor

From @jhkimnew on March 1, 2018 1:19

We need to update DOC to inform this limiation regarding IISExpress.

Unlike full IIS, IISExpress should restart after switching hostingModel from inprocess to outofprocess because it does not use WAS service.

Copied from original issue: aspnet/IISIntegration#621

@guardrex
Copy link
Collaborator

guardrex commented Mar 6, 2018

@jhkimnew @shirhatti Should we say a bit more ... should it say how the restart may negatively impact an app/hosting (examples)?

Also, confirm: Should this bit describe setting hostingModel? (applicationHost.config? ... I'm looking at some resources now on how IIS Express is configured)

Related: Allow IISExpress deployer to deploy either inprocess or outofprocess based on a deployment parameter (aspnet/Hosting #1260)

@jhkimnew
Copy link

jhkimnew commented Mar 6, 2018

@pan-wang Can you add more detailed information about why IISExpress needs to be restarted manually when hostingModel is changed?

@guardrex
Copy link
Collaborator

Yes, I need more background info and context to document this.

cc/ @jkotalik You had a PR (aspnet/Hosting #1261) on at least part of this. Can you help?

RE: Where?

One of the problems to address is where we should document this. We don't have much to say about IIS Express configuration in this doc set. It's not really a Host and deploy thing. It doesn't fit with the app-centered Hosting or Error handling topics. Since IIS Express is used for local debugging, it feels more like a Test and Debug area thing, but we don't document IIS Express there. As things stand, I don't know where we put this content.

RE: Content

I understand that IIS Express starts and the process continues to run after it's started (it continues to run even after the debugger is stopped in VS). If the hostingModel is changed either way (inprocess to out- or out- to in-), I think I understand that you're saying that IIS Express must be restarted manually to pickup the change. Since stopping the debugger in VS doesn't stop the IIS Express process, what do we need to say about how to manually restart IIS Express if the hostingModel is changed?

RE: Configuration of hostingModel

Are we talking applicationhost.config kept in %userprofile%\documents\IISExpress\config? "hostingModel" isn't in the file (on my machine anyway). How is the hostingModel configured?

@guardrex
Copy link
Collaborator

@vaidy4github Is this issue covered by any of your IIS Express docs?

TL;DR: Unlike full IIS, IISExpress should be restarted after switching hostingModel from in-process to out-of-process because it does not use the WAS service.

@shirhatti
Copy link
Contributor Author

Also, confirm: Should this bit describe setting hostingModel? (applicationHost.config? ... I'm looking at some resources now on how IIS Express is configured)

The eventual goal is to add a drop-down to the project property page that allows you to pick between the different hosting model.
It can also be achieved by adding this property to your csproj.

  <PropertyGroup>
    <AspNetCoreModuleHostingModel>inprocess</AspNetCoreModuleHostingModel>
  </PropertyGroup>

Or overridden via a launch profile in launchSettings.json

I'd suggest tracking this as part of the uber issue you've created for ANCM in-proc. We can setup a meeting where I demo in-proc when you're ready to actually to tackle this doc.

@guardrex
Copy link
Collaborator

@shirhatti I'm glad u mentioned that. It clears up my Where? question. But one thing tho ...

I didn't know we would have a separate topic for inproc. I thought we'd be rolling it into the current ANCM topic in Servers (as perhaps just an overview section) and into the current ANCM reference topic in Host and deploy: Host on Windows with the details.

Is there enough content to have a standalone topic just for inproc?

Your configuration notes are perfect, but what do we need to say about how to restart IIS after the hostingModel setting is changed? Today, it looks like you have to manually kill the IIS Express process (guessing).

@jkotalik
Copy link
Contributor

The inprocess mode is large enough to delicate a new document section for it. Though it bootstraps through ANCM, in managed code it is a completely different hosting model (uses a custom IServer).

Once the hostingModel setting has been changed in the web.config file, ANCM will notice a configuration change and recycle the worker process for IIS. For IISExpress, instead of recycling will trigger a graceful shutdown and close the current iisexpress process.

@guardrex guardrex added the 2.1 label Mar 16, 2018
@guardrex
Copy link
Collaborator

guardrex commented Mar 16, 2018

Once the hostingModel setting has been changed in the web.config file, ANCM will notice a configuration change and recycle the worker process for IIS. For IISExpress, instead of recycling will trigger a graceful shutdown and close the current iisexpress process.

Perfect ... thanks. That's exactly what I needed to know.

I think I have everything (that's known to date) to document it. Please ping me here with any new developments. I've been so busy with doc issues that I'm having a hard time keeping up with engineering repo issues.

Cross-ref: https://blogs.msdn.microsoft.com/webdev/2018/02/28/asp-net-core-2-1-0-preview1-improvements-to-iis-hosting/

@guardrex guardrex added 2.2 and removed 2.1 labels Apr 11, 2018
@guardrex guardrex modified the milestones: 2018 - Quarter 2, Backlog Apr 11, 2018
@guardrex guardrex changed the title ANCM: Doc: IISExpress should restart after switching hostingModel from inprocess to outofprocess ANCM: IISExpress and switching hostingModel Jun 20, 2018
@guardrex guardrex mentioned this issue Sep 4, 2018
32 tasks
@guardrex guardrex modified the milestones: Backlog, Sprint 141 (9/3 to 9/21) Sep 4, 2018
@guardrex
Copy link
Collaborator

guardrex commented Sep 19, 2018

@jkotalik Quick check: In-proc was originally planned for 2.1 as opt-in (not the default) ... is that the same for 2.2 ... opt-in (not the default; must be set by the dev either via web.config or via the project file property), correct?

... and what's your preferred guidance for configuration? ... Personally, I like the project file property.

@jkotalik
Copy link
Contributor

Opt in, but templates/ file new in 2.2 will default to inprocess for all IISExpress scenarios.

@guardrex
Copy link
Collaborator

will default to inprocess for all IISExpress scenarios

Ok, gotcha.

How about the guidance ... push the project file property over the web.config file approach?

@guardrex
Copy link
Collaborator

... and I'll get ...

Or overridden via a launch profile in launchSettings.json

... too.

@jkotalik
Copy link
Contributor

@shirhatti we should discuss the launchSettings.json experience.

And yes push the project file property. We have always pushed for users not having web.configs in their app.

@guardrex
Copy link
Collaborator

We have always pushed for users not having web.configs in their app.

Yes, all of the docs lean that way. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants