Skip to content

Conversation

@eerhardt
Copy link
Member

It is not intended that normal execution has a null ApplicationName, so don't make callers need to check for null. When an ApplicationName is not available, it is set to string.Empty.

Fix #68512

It is not intended that normal execution has a null ApplicationName, so don't make callers need to check for null. When an ApplicationName is not available, it is set to string.Empty.

Fix dotnet#68512
@ghost
Copy link

ghost commented Jul 27, 2022

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost ghost assigned eerhardt Jul 27, 2022
@ghost
Copy link

ghost commented Jul 27, 2022

Tagging subscribers to this area: @dotnet/area-extensions-hosting
See info in area-owners.md if you want to be subscribed.

Issue Details

It is not intended that normal execution has a null ApplicationName, so don't make callers need to check for null. When an ApplicationName is not available, it is set to string.Empty.

Fix #68512

Author: eerhardt
Assignees: -
Labels:

new-api-needs-documentation, area-Extensions-Hosting

Milestone: -

@eerhardt
Copy link
Member Author

@halter73 - any concern with using string.Empty instead of <Unknown> here?

Copy link
Member

@halter73 halter73 left a comment

Choose a reason for hiding this comment

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

I think using string.Empty instead of something like <Unknown> is reasonable since hosting assumes that a non-empty app name is the name of the assembly containing the UserSecretsIdAttribute. It's easier to special case string.Empty than <Unknown>, and still communicates that a good default app name couldn't be determined.

@eerhardt eerhardt merged commit 028e556 into dotnet:main Aug 1, 2022
@eerhardt eerhardt deleted the Fix68512 branch August 1, 2022 15:22
@ghost ghost locked as resolved and limited conversation to collaborators Aug 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: Make IHostEnvironment.ApplicationName non-nullable

3 participants