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

IHostingStartup topic #4967

Merged
merged 9 commits into from
Dec 13, 2017
Merged

IHostingStartup topic #4967

merged 9 commits into from
Dec 13, 2017

Conversation

guardrex
Copy link
Collaborator

@guardrex guardrex commented Dec 11, 2017

@guardrex
Copy link
Collaborator Author

@Tratcher Alrighty ... now that I've got us on the correct PR ...

I'll cover the relevant bits that I find from the discussion in dotnet/aspnetcore#2051 and ping u back.

@guardrex guardrex changed the title IHostingStartup topic [WIP] IHostingStartup topic Dec 11, 2017
@guardrex
Copy link
Collaborator Author

@Tratcher I added two sections: Discovery to cover troubleshooting/debugging and a bit on globally disabling the automatically loaded hosting startup assemblies. What else would help in these regards?

@guardrex guardrex changed the title [WIP] IHostingStartup topic IHostingStartup topic Dec 12, 2017
Copy link
Member

@Tratcher Tratcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move these new sections to the very top right after the opening paragraph, they are applicable to the most users. Comparatively few users implement this feature.


## Discover loaded hosting startup assemblies

To discover hosting startup assemblies loaded by the app or libraries added to the app, read the value of the [HostingStartupAssembliesKey](/dotnet/api/microsoft.aspnetcore.hosting.webhostdefaults.hostingstartupassemblieskey). The sample app reads the key into a `string` array and displays the result in the app's Index page:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


When either the host setting or the environment variable is set to `true` or `1`, hosting startup assemblies aren't automatically loaded. If both are set, the host setting controls the behavior.

It isn't currently possible to selectively disable a hosting startup assembly added by a library unless the library offers its own configuration option. Disabling hosting startup assemblies using the host setting or environment variable disables them globally and may disable several features of an app.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

want to link currently to the 2.1 bug that added this feature?
aspnet/Hosting#1243

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't generally discuss 2.1 features in the 2.0-era docs. @Rick-Anderson Do you want to make an exception here? I can say something to the effect that 'a future release will offer this feature' and then link that issue. I believe we have done that a few times in the past.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guardrex yes

@guardrex
Copy link
Collaborator Author

move these new sections to the very top right after the opening paragraph

👍

@guardrex
Copy link
Collaborator Author

@Tratcher 👍 See how those updates look.

Internal Review Topic

Copy link
Contributor

@Rick-Anderson Rick-Anderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the one long sentence. Do you really need to say in the runtime store?


### Update the dependencies file

In order for the feature to activate for an app, the `runtime` location in the *\*.deps.json* file must be changed to reflect the location of the feature's runtime assembly in the runtime store. Prefix the `runtime` location with `lib/netcoreapp2.0/`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Way too long. Alt:
The runtime location for features is specified in the *.deps.json file. To active a feature, the runtime must include the location of the feature's runtime assembly. Prefix the runtime location with lib/netcoreapp2.0/:

Or can you make a bullet list?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try a shorter version of this that breaks the sentence as you suggest.


## Sample app

The [sample app](https://github.com/aspnet/Docs/tree/master/aspnetcore/hosting/ihostingstartup/sample/) ([how to download](xref:tutorials/index#how-to-download-a-sample)) uses `IHostingStartup` to create a diagnostics tool. The tool adds two middlewares to the app at startup that provide diagnostic information:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

provides ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "two middlewares" "provide" (plural verb) 'the feature.' I think we're ok here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the reason that I'm focusing on "two middlewares" and not "the tool" is that the object of "that" feels like it refers to the "two middlewares" more than "the tool." This is the way that I would speak the sentence verbally.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. That's why I put ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol 😄 I don't take anything you suggest lightly!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍻


## Discover loaded hosting startup assemblies

To discover hosting startup assemblies loaded by the app or by libraries, enable logging and check the application logs. Errors that occur when loading assemblies are also logged. Loaded hosting startup assemblies are logged at the Debug level, and errors are always logged.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Errors that occur when loading assemblies are also logged

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and errors are always logged.

How about
and all errors are logged.


To discover hosting startup assemblies loaded by the app or by libraries, enable logging and check the application logs. Errors that occur when loading assemblies are also logged. Loaded hosting startup assemblies are logged at the Debug level, and errors are always logged.

It's also possible to read the value of the [HostingStartupAssembliesKey](/dotnet/api/microsoft.aspnetcore.hosting.webhostdefaults.hostingstartupassemblieskey). The sample app reads the key into a `string` array and displays the result in the app's Index page:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also possible to read the value of the
You can read the value of the

Copy link
Contributor

@Rick-Anderson Rick-Anderson Dec 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or better yet, nuke that entire sentence. The sample reads the HostingStartupAssembliesKey key into ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make the change, but this is an alternative to the first option of looking at the logs. This loses it's conversational tone by jumping right to 'the sample does Y for this' here.

@Rick-Anderson Rick-Anderson merged commit cfe5a36 into dotnet:master Dec 13, 2017
@guardrex guardrex deleted the ihostingstartup-topic branch December 13, 2017 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants