Skip to content

[API Implementation]: Expose StopTheHostException#69404

Merged
eerhardt merged 10 commits intodotnet:mainfrom
deeprobin:issue-60600
Jun 1, 2022
Merged

[API Implementation]: Expose StopTheHostException#69404
eerhardt merged 10 commits intodotnet:mainfrom
deeprobin:issue-60600

Conversation

@deeprobin
Copy link
Contributor

Proposal implementation of #60600 (closes #60600)

It took a little longer than planned. Thanks for waiting.

Proposal

namespace Microsoft.Extensions.Hosting
{
    [Serializable]
    public sealed partial class HostAbortedException : Exception
    {
        public HostAbortedException() { }
        private HostAbortedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
        public HostAbortedException(string? message) { }
        public HostAbortedException(string? message, System.Exception? innerException) { }
    }
}

Current state of implementation

  • Proposal implementation
  • Reference assembly
  • Tests

/cc @maryamariyan

@ghost
Copy link

ghost commented May 16, 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 added the community-contribution Indicates that the PR has been added by a community member label May 16, 2022
@ghost
Copy link

ghost commented May 16, 2022

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

Issue Details

Proposal implementation of #60600 (closes #60600)

It took a little longer than planned. Thanks for waiting.

Proposal

namespace Microsoft.Extensions.Hosting
{
    [Serializable]
    public sealed partial class HostAbortedException : Exception
    {
        public HostAbortedException() { }
        private HostAbortedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
        public HostAbortedException(string? message) { }
        public HostAbortedException(string? message, System.Exception? innerException) { }
    }
}

Current state of implementation

  • Proposal implementation
  • Reference assembly
  • Tests

/cc @maryamariyan

Author: deeprobin
Assignees: -
Labels:

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

Milestone: -

Co-Authored-By: Eric Erhardt <eric.erhardt@microsoft.com>
@deeprobin deeprobin requested review from danmoseley and eerhardt May 21, 2022 14:44
@deeprobin
Copy link
Contributor Author

@maryamariyan Please give a review too 👍🏼

@deeprobin
Copy link
Contributor Author

By the way, is it correct that build.cmd -vs Microsoft.Extensions.HostFactoryResolver does not work?
Or why is there no solution file for the project?

@eerhardt
Copy link
Member

By the way, is it correct that build.cmd -vs Microsoft.Extensions.HostFactoryResolver does not work?
Or why is there no solution file for the project?

This library is "special" in that it doesn't actually produce a library in the traditional sense.

<!-- This is a source package which includes all .cs files by default. -->
<IsSourcePackage>true</IsSourcePackage>

This is a nuget package that contains the .cs files. When consumers use this package, these files get included directly in the consumer's project. So no .dll gets created by this library.

That said, this folder still contains a test project, and the src still has a csproj file, even though it doesn't build a .dll. So I'm not sure why there isn't a .sln file. It may have just been an oversite.

@ViktorHofer - do you happen to know why there is no .sln file here?

@ViktorHofer
Copy link
Member

@ViktorHofer - do you happen to know why there is no .sln file here?

Most probably an unintentional omission in d13863e, which added the library to dotnet/runtime. Feel free to add one.

@deeprobin
Copy link
Contributor Author

@ViktorHofer - do you happen to know why there is no .sln file here?

Most probably an unintentional omission in d13863e, which added the library to dotnet/runtime. Feel free to add one.

Should I do that right along with this PR or would it be better to write an issue for it and do that in a follow up?

@ViktorHofer
Copy link
Member

No need for an issue, that would be way too much overhead. Just add it to this PR. And don't bother with the version header at the top of the solution file as that will be overwritten anyways, whenever we batch update all solution files.

@eerhardt
Copy link
Member

eerhardt commented Jun 1, 2022

runtime (Libraries Test Run release mono Linux x64 Debug) failure is #13757
runtime (Build Browser wasm Linux Release LibraryTests) failure is #58643

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the contribution.

@dougbu
Copy link
Contributor

dougbu commented Jun 3, 2022

This PR is, I believe, causing problems in dotnet/aspnetcore#41999. We use Microsoft.Extensions.HostFactoryResolver.Sources and it seems src/libraries/Microsoft.Extensions.HostFactoryResolver/src/HostFactoryResolver.cs ended up w/o the necessary reference to Microsoft.Extensions.Hosting in our scenarios. Do we need to react or should we expect a fix in the M.E.HFR.Sources package❔

dougbu added a commit to dotnet/aspnetcore that referenced this pull request Jun 3, 2022
- now need a Microsoft.Extensions.Hosting reference to use Microsoft.Extensions.HostFactoryResolver.Sources
dougbu added a commit to dotnet/aspnetcore that referenced this pull request Jun 3, 2022
- this was a dead end; waiting instead for a dotnet/runtime fix

This reverts commit 62ced99.
dotnet-maestro bot added a commit to dotnet/aspnetcore that referenced this pull request Jun 7, 2022
[main] Update dependencies from dotnet/efcore dotnet/runtime


 - Work around dotnet/runtime#69404 break
- now need a Microsoft.Extensions.Hosting reference to use Microsoft.Extensions.HostFactoryResolver.Sources

 - Revert "Work around dotnet/runtime#69404 break"
- this was a dead end; waiting instead for a dotnet/runtime fix

This reverts commit 62ced99.
captainsafia pushed a commit to captainsafia/aspnetcore that referenced this pull request Jun 13, 2022
…41999)

[main] Update dependencies from dotnet/efcore dotnet/runtime


 - Work around dotnet/runtime#69404 break
- now need a Microsoft.Extensions.Hosting reference to use Microsoft.Extensions.HostFactoryResolver.Sources

 - Revert "Work around dotnet/runtime#69404 break"
- this was a dead end; waiting instead for a dotnet/runtime fix

This reverts commit 62ced99.
@ghost ghost locked as resolved and limited conversation to collaborators Jul 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Extensions-Hosting community-contribution Indicates that the PR has been added by a community member new-api-needs-documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StopTheHostException should be made public to be dealt with gracefully

8 participants