Skip to content

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

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

Merged
merged 9 commits into from
Jun 7, 2022

Conversation

dotnet-maestro[bot]
Copy link
Contributor

@dotnet-maestro dotnet-maestro bot commented Jun 2, 2022

This pull request updates the following dependencies

From https://github.com/dotnet/efcore

  • Subscription: 8ce5251e-8269-419d-3b2a-08d8b8050dda
  • Build: 20220602.1
  • Date Produced: June 2, 2022 10:19:27 AM UTC
  • Commit: f43f454304620596930d5b82319a03baf8ea7ae9
  • Branch: refs/heads/main

From https://github.com/dotnet/runtime

  • Subscription: 32db3699-5666-45da-a1b7-08d8b804cd75
  • Build: 20220606.7
  • Date Produced: June 7, 2022 9:15:01 AM UTC
  • Commit: eef6c7f6cb7f73163313d349fbb796f37b4c3996
  • Branch: refs/heads/main

…602.1

dotnet-ef , Microsoft.EntityFrameworkCore , Microsoft.EntityFrameworkCore.Design , Microsoft.EntityFrameworkCore.InMemory , Microsoft.EntityFrameworkCore.Relational , Microsoft.EntityFrameworkCore.Sqlite , Microsoft.EntityFrameworkCore.SqlServer , Microsoft.EntityFrameworkCore.Tools
 From Version 7.0.0-preview.6.22301.7 -> To Version 7.0.0-preview.6.22302.1
@dotnet-maestro dotnet-maestro bot requested review from a team, dougbu and wtgodbe as code owners June 2, 2022 10:49
@ghost ghost added area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework Type: Dependency Update 🔼 labels Jun 2, 2022
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Auto-approving dependency update.

…0601.11

Microsoft.Extensions.Caching.Abstractions , Microsoft.Extensions.Caching.Memory , Microsoft.Extensions.Configuration , Microsoft.Extensions.Configuration.Abstractions , Microsoft.Extensions.Configuration.Binder , Microsoft.Extensions.Configuration.CommandLine , Microsoft.Extensions.Configuration.EnvironmentVariables , Microsoft.Extensions.Configuration.FileExtensions , Microsoft.Extensions.Configuration.Ini , Microsoft.Extensions.Configuration.Json , Microsoft.Extensions.Configuration.UserSecrets , Microsoft.Extensions.Configuration.Xml , Microsoft.Extensions.DependencyInjection , Microsoft.Extensions.DependencyInjection.Abstractions , Microsoft.Extensions.DependencyModel , Microsoft.Extensions.FileProviders.Abstractions , Microsoft.Extensions.FileProviders.Composite , Microsoft.Extensions.FileProviders.Physical , Microsoft.Extensions.FileSystemGlobbing , Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Extensions.Hosting , Microsoft.Extensions.Hosting.Abstractions , Microsoft.Extensions.Http , Microsoft.Extensions.Logging , Microsoft.Extensions.Logging.Abstractions , Microsoft.Extensions.Logging.Configuration , Microsoft.Extensions.Logging.Console , Microsoft.Extensions.Logging.Debug , Microsoft.Extensions.Logging.EventLog , Microsoft.Extensions.Logging.EventSource , Microsoft.Extensions.Logging.TraceSource , Microsoft.Extensions.Options , Microsoft.Extensions.Options.ConfigurationExtensions , Microsoft.Extensions.Options.DataAnnotations , Microsoft.Extensions.Primitives , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Configuration.ConfigurationManager , System.Diagnostics.DiagnosticSource , System.Diagnostics.EventLog , System.DirectoryServices.Protocols , System.IO.Pipelines , System.Net.Http.Json , System.Net.Http.WinHttpHandler , System.Reflection.Metadata , System.Resources.Extensions , System.Security.Cryptography.Pkcs , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceProcess.ServiceController , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Threading.Channels , System.Threading.RateLimiting
 From Version 7.0.0-preview.6.22281.7 -> To Version 7.0.0-preview.6.22301.11
@dotnet-maestro dotnet-maestro bot changed the title [main] Update dependencies from dotnet/efcore [main] Update dependencies from dotnet/efcore dotnet/runtime Jun 2, 2022
- now need a Microsoft.Extensions.Hosting reference to use Microsoft.Extensions.HostFactoryResolver.Sources
@dotnet-maestro dotnet-maestro bot requested a review from Pilchie as a code owner June 3, 2022 01:14
@dougbu
Copy link
Contributor

dougbu commented Jun 3, 2022

This is a mess because GetDocument/Insider intentionally references an old version of System.Diagnostics.DiagnosticsSource and now we're hitting

src/Tools/GetDocumentInsider/src/GetDocument.Insider.csproj(0,0): error NU1605: (NETCORE_ENGINEERING_TELEMETRY=Restore) Detected package downgrade: System.Diagnostics.DiagnosticSource from 7.0.0-preview.6.22301.11 to 4.6.0. Reference the package directly from the project to select a different version. 
 GetDocument.Insider -> Microsoft.Extensions.Hosting 7.0.0-preview.6.22301.11 -> Microsoft.Extensions.Logging 7.0.0-preview.6.22301.11 -> System.Diagnostics.DiagnosticSource (>= 7.0.0-preview.6.22301.11) 
 GetDocument.Insider -> System.Diagnostics.DiagnosticSource (>= 4.6.0)

The project already references System.Diagnostics.DiagnosticSource v4.6.0 directly. But that's pulling the version down rather than up.

/cc @deeprobin @eerhardt @ViktorHofer

@dougbu
Copy link
Contributor

dougbu commented Jun 3, 2022

What I'd prefer is for a revert of dotnet/runtime#69404 or a follow-up change that includes HostFactoryResolver.cs in the .Sources package.

@ViktorHofer
Copy link
Member

What I'd prefer is for a revert of dotnet/runtime#69404 or a follow-up change that includes HostFactoryResolver.cs in the .Sources package.

HostFactoryResolver.cs is already part of the Microsoft.Extensions.HostFactoryResolver.Sources package?

@dougbu I don't fully understand what the actual issue is. Can you please provide more information? Is it that the HostFactoryResolver source file now depends on the HostAbortedException in Mirosoft.Extensions.Hosting?

…0602.9

Microsoft.Extensions.Caching.Abstractions , Microsoft.Extensions.Caching.Memory , Microsoft.Extensions.Configuration , Microsoft.Extensions.Configuration.Abstractions , Microsoft.Extensions.Configuration.Binder , Microsoft.Extensions.Configuration.CommandLine , Microsoft.Extensions.Configuration.EnvironmentVariables , Microsoft.Extensions.Configuration.FileExtensions , Microsoft.Extensions.Configuration.Ini , Microsoft.Extensions.Configuration.Json , Microsoft.Extensions.Configuration.UserSecrets , Microsoft.Extensions.Configuration.Xml , Microsoft.Extensions.DependencyInjection , Microsoft.Extensions.DependencyInjection.Abstractions , Microsoft.Extensions.DependencyModel , Microsoft.Extensions.FileProviders.Abstractions , Microsoft.Extensions.FileProviders.Composite , Microsoft.Extensions.FileProviders.Physical , Microsoft.Extensions.FileSystemGlobbing , Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Extensions.Hosting , Microsoft.Extensions.Hosting.Abstractions , Microsoft.Extensions.Http , Microsoft.Extensions.Logging , Microsoft.Extensions.Logging.Abstractions , Microsoft.Extensions.Logging.Configuration , Microsoft.Extensions.Logging.Console , Microsoft.Extensions.Logging.Debug , Microsoft.Extensions.Logging.EventLog , Microsoft.Extensions.Logging.EventSource , Microsoft.Extensions.Logging.TraceSource , Microsoft.Extensions.Options , Microsoft.Extensions.Options.ConfigurationExtensions , Microsoft.Extensions.Options.DataAnnotations , Microsoft.Extensions.Primitives , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Configuration.ConfigurationManager , System.Diagnostics.DiagnosticSource , System.Diagnostics.EventLog , System.DirectoryServices.Protocols , System.IO.Pipelines , System.Net.Http.Json , System.Net.Http.WinHttpHandler , System.Reflection.Metadata , System.Resources.Extensions , System.Security.Cryptography.Pkcs , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceProcess.ServiceController , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Threading.Channels , System.Threading.RateLimiting
 From Version 7.0.0-preview.6.22281.7 -> To Version 7.0.0-preview.6.22302.9
@eerhardt
Copy link
Member

eerhardt commented Jun 3, 2022

Is it that the HostFactoryResolver source file now depends on the HostAbortedException in Mirosoft.Extensions.Hosting?

Yes. This was my mistake. The new exception should have gone in the Mirosoft.Extensions.Hosting.Abstractions library. I'll get a fix in dotnet/runtime for this ASAP.

@dougbu
Copy link
Contributor

dougbu commented Jun 3, 2022

What I'd prefer is for a revert of dotnet/runtime#69404 or a follow-up change that includes HostFactoryResolver.cs in the .Sources package.

My bad. Should have said "HostAbortedException.cs".

The new exception should have gone in the Mirosoft.Extensions.Hosting.Abstractions library.

I'm not sure that would help in the GetDocument.Insider project. That intentionally has very old and very few dependencies and targets netcoreapp2.1 and net462. The point of using Microsoft.Extensions.HostFactoryResolver.Sources is to keep those dependencies lean and leave the "inside man" lib compatible w/ a very broad swath of ASP.NET Core web sites.

Please place HostAbortedException in the .Sources package instead. Worst case, use #if to decide between an exception in the Abstractions library and something in the .Sources package (maybe an optionally-defined inner class).

@javiercn
Copy link
Member

javiercn commented Jun 3, 2022

Please place HostAbortedException in the .Sources package instead. Worst case, use #if to decide between an exception in the Abstractions library and something in the .Sources package (maybe an optionally-defined inner class).

That's not going to work because the type won't have the same identity as the one in Microsoft.Extensions.Hosting, isn't that the case?

@dougbu
Copy link
Contributor

dougbu commented Jun 3, 2022

That's not going to work because the type won't have the same identity as the one in Microsoft.Extensions.Hosting, isn't that the case?

The requirement we have is a .Sources package that doesn't introduce any 7.0.x dependencies. I'm not positive what will work exactly but would say the HostAbortedException is new and my suggestion, though clunky, at least uses an Exception subclass.

May be better to either stick w/ only throwing InvalidOperationException but making StopTheHostException public.

- this was a dead end; waiting instead for a dotnet/runtime fix

This reverts commit 62ced99.
@eerhardt
Copy link
Member

eerhardt commented Jun 3, 2022

That intentionally has very old and very few dependencies and targets netcoreapp2.1

netcoreapp2.1 is EOL, and we no longer support it. All the packages we build now explicitly block consumers targetting netcoreapp2.1. Why is this tool intentionally targeting an EOL runtime?

@eerhardt
Copy link
Member

eerhardt commented Jun 3, 2022

See dotnet/runtime#60600 to provide a bit more background on the change. App devs need a way to know if the exception getting thrown is coming from the HostFactoryResolver or not. If we don't make a specific exception type for it, the only other way this information could be conveyed is:

  • Reuse an existing System. exception, and then set some special state on it that app devs would need to inspect.
  • Continue what they need to do today and check that the exception.GetType().Name is some special string.

Those approaches feel more fragile and not at all idiomatic .NET approaches.

I'd like to better understand why GetDocument.Insider can't be upgraded to reference Microsoft.Extensions.Hosting.Abstractions.

cc @davidfowl @maryamariyan

@dougbu
Copy link
Contributor

dougbu commented Jun 3, 2022

Why is this tool intentionally targeting an EOL runtime?

Because customers don't follow EOL rules religiously and our partners, like NSwag, support even older packages.

All the packages we build now explicitly block consumers targetting netcoreapp2.1.

That isn't the case for Microsoft.Extensions.ApiDescription.Server but it also doesn't really matter. A 7.0.x dependency won't work in a 3.1.x or 6.0.x web application either.

One general point is Microsoft.Extensions.ApiDescription.Server has no dependencies at all. Any dependency won't work when loading its "inside man" assembly into an existing 2.1, 3.1 or 6.0 web site. Another is it's Just Wrong:tm: for Microsoft.Extensions.HostFactoryResolver.Sources to expect anything of its environment.

@dougbu
Copy link
Contributor

dougbu commented Jun 3, 2022

App devs need a way to know if the exception getting thrown is coming from the HostFactoryResolver or not.

Why not expose HostFactoryResolver.StopTheHostException or (w/ the rename) HostFactoryResolver.HostAbortedException❔ The HostFactoryResolver will be compiled into their application and the Exception will have the right identity.

@eerhardt
Copy link
Member

eerhardt commented Jun 3, 2022

The HostFactoryResolver will be compiled into their application and the Exception will have the right identity.

That's not how it works, unfortunately. The user's application doesn't reference HostFactoryResolver, the tools do. HostFactoryResolver doesn't even get published to nuget.org. It is only a .Sources package so the code can be shared between aspnetcore and ef.

@dougbu
Copy link
Contributor

dougbu commented Jun 3, 2022

It is only a .Sources package so the code can be shared between aspnetcore and ef.

Right. And with the recent changes in dotnet/runtime, it's no longer suited for that purpose.

I wasn't aware of e847f57 changes in GetDocument.Insider.csproj (didn't delve into @davidfowl's change in #33397) and suspect it also broke compatibility w/ 2.1, 3.1, and 6.0 web sites. My leaning here is to completely give up on newer versions of the Microsoft.Extensions.HostFactoryResolver.Sources package and pin ourselves at the preview2 version, reverting the previous reaction as well.

Bottom line, I can't see how Microsoft.Extensions.ApiDescription.Server can work w/ 2.1, 3.1, or 6.0 web sites since dotnet/runtime#53757 went in. Communication with only 7.0 hosts busts things.

@eerhardt
Copy link
Member

eerhardt commented Jun 3, 2022

One potential option here is to change HostResolverFactory to only throw the new, public HostAbortedException if the tool consuming it is targeting net6.0+. When #if !NET_6_0_OR_GREATER, we continue throwing the private StopTheHostException. This will allow tools that want to remain on older TFMs to keep working without taking a dependency on Microsoft.Extensions.Hosting.Abstractions.

Apps / libraries that want to work with these "older-support" tools (like GetDocument.Insider) might have to check for both exceptions for a while, until all the tools are updated to net6.0+. But this becomes a tool decision.

Alternatively, instead of #ifing on the TFM, we add a new DEFINE to HostResolverFactory - HOSTRESOLVERFACTORY_SUPPRESS_ABSTRACTIONS_DEPENDENCY. When this define is set, HostResolverFactory will throw the private exception, and not depend on the new public exception. When it isn't defined, we do what we are doing now - throw HostAbortedException. We could name both exceptions the exact same, so if an app wants to work with GetDocument.Insider - they just need one check - based off the exception.GetType().Name.

Thoughts?

@dougbu
Copy link
Contributor

dougbu commented Jun 3, 2022

Think I'm missing something @eerhardt. How does a tool throwing an Exception become something an app can interact with at all❔ The "inside man" here (and likely in EF scenarios) isn't part of the user's application at all, except when running tools like dotnet ef and dotnet getdocument.

@eerhardt
Copy link
Member

eerhardt commented Jun 3, 2022

Spoke with @davidfowl - and the approach he recommends is for the HostFactoryResolver to Type.GetType("Microsoft.Extensions.Hosting.HostAbortedException"). If the HostFactoryResolver finds the type in the app, it will create an instance of it, and throw it. That way, going forward users can just try-catch that exception and skip it.

If a HostAbortedException can't be found in the app, then throw its own private HostAbortedException, that we previously did (renamed from StopTheHostException).

We still want to move the exception to the Abstractions library as well. But we won't take a direct dependency from HostFactoryResolver to the 7.0 version of Microsoft.Extensions.Hosting.Abstractions.

@dougbu
Copy link
Contributor

dougbu commented Jun 3, 2022

I'm guessing that'll work @eerhardt @davidfowl

I also remain concerned about the reference to System.Diagnostics.DiagnosticSource added in e847f57. Won't that cause the same kind of problems as-is❔ And, if for example we added that as a dependency of the Microsoft.Extensions.ApiDescription.Server package (no, there's nothing like that at the moment), I expect conflicts if a user's web site project also has a dependency on System.Diagnostics.DiagnosticSource.

@dougbu
Copy link
Contributor

dougbu commented Jun 4, 2022

@davidfowl I am missing part of the context here. Could you chime in here on consuming diagnostic events in HostFactoryResolver since dotnet/runtime#53757❔ I can't see how that would work in 2.1, 3.1, or 6.0 web sites and suspect the new usings there will only resolve correctly in GetDocument.Insider in a few odd cases, not the mainline scenarios.

The semi-good news here is Swashbuckle.AspNetCore still uses Microsoft.Extensions.ApiDescription.Server v3.0.0 and NSwag.AspNetCore uses v6.0.3.

The likely bad news is current versions of the EFCore.Design project target net6.0 but use Microsoft.Extensions.HostFactoryResolver.Sources v7.0.0-preview.6.22279.1. That project is probably still compiling because they are getting "lucky" w/ transitive references. Unclear however that their tools still support customer net6.0 projects unless dotnet/runtime#53757 is also in release/6.0. Thoughts❔

(Hmm @captainsafia should Swashbuckle move forward to a 6.0.x version too❔ That remains much more version-independent than what we're currently doing in 7.0.x.)

@davidfowl
Copy link
Member

Can you clarify what you're asking here?

…0603.5

Microsoft.Extensions.Caching.Abstractions , Microsoft.Extensions.Caching.Memory , Microsoft.Extensions.Configuration , Microsoft.Extensions.Configuration.Abstractions , Microsoft.Extensions.Configuration.Binder , Microsoft.Extensions.Configuration.CommandLine , Microsoft.Extensions.Configuration.EnvironmentVariables , Microsoft.Extensions.Configuration.FileExtensions , Microsoft.Extensions.Configuration.Ini , Microsoft.Extensions.Configuration.Json , Microsoft.Extensions.Configuration.UserSecrets , Microsoft.Extensions.Configuration.Xml , Microsoft.Extensions.DependencyInjection , Microsoft.Extensions.DependencyInjection.Abstractions , Microsoft.Extensions.DependencyModel , Microsoft.Extensions.FileProviders.Abstractions , Microsoft.Extensions.FileProviders.Composite , Microsoft.Extensions.FileProviders.Physical , Microsoft.Extensions.FileSystemGlobbing , Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Extensions.Hosting , Microsoft.Extensions.Hosting.Abstractions , Microsoft.Extensions.Http , Microsoft.Extensions.Logging , Microsoft.Extensions.Logging.Abstractions , Microsoft.Extensions.Logging.Configuration , Microsoft.Extensions.Logging.Console , Microsoft.Extensions.Logging.Debug , Microsoft.Extensions.Logging.EventLog , Microsoft.Extensions.Logging.EventSource , Microsoft.Extensions.Logging.TraceSource , Microsoft.Extensions.Options , Microsoft.Extensions.Options.ConfigurationExtensions , Microsoft.Extensions.Options.DataAnnotations , Microsoft.Extensions.Primitives , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Configuration.ConfigurationManager , System.Diagnostics.DiagnosticSource , System.Diagnostics.EventLog , System.DirectoryServices.Protocols , System.IO.Pipelines , System.Net.Http.Json , System.Net.Http.WinHttpHandler , System.Reflection.Metadata , System.Resources.Extensions , System.Security.Cryptography.Pkcs , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceProcess.ServiceController , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Threading.Channels , System.Threading.RateLimiting
 From Version 7.0.0-preview.6.22281.7 -> To Version 7.0.0-preview.6.22303.5
@dougbu
Copy link
Contributor

dougbu commented Jun 4, 2022

I'm asking how dotnet-getdocument and its GetDocument.Insider inside man could possibly work when attempting to integrate with 2.1, 3.1, or 6.0 web projects. The combination of additional usings and System.Diagnostics.DiagnosticSource dependency that's not declared in the Microsoft.Extensions.ApiDescription.Server package scares me.

I'm having trouble testing these scenarios but don't expect good news. In the meantime, what are your thoughts❔

…0604.5

Microsoft.Extensions.Caching.Abstractions , Microsoft.Extensions.Caching.Memory , Microsoft.Extensions.Configuration , Microsoft.Extensions.Configuration.Abstractions , Microsoft.Extensions.Configuration.Binder , Microsoft.Extensions.Configuration.CommandLine , Microsoft.Extensions.Configuration.EnvironmentVariables , Microsoft.Extensions.Configuration.FileExtensions , Microsoft.Extensions.Configuration.Ini , Microsoft.Extensions.Configuration.Json , Microsoft.Extensions.Configuration.UserSecrets , Microsoft.Extensions.Configuration.Xml , Microsoft.Extensions.DependencyInjection , Microsoft.Extensions.DependencyInjection.Abstractions , Microsoft.Extensions.DependencyModel , Microsoft.Extensions.FileProviders.Abstractions , Microsoft.Extensions.FileProviders.Composite , Microsoft.Extensions.FileProviders.Physical , Microsoft.Extensions.FileSystemGlobbing , Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Extensions.Hosting , Microsoft.Extensions.Hosting.Abstractions , Microsoft.Extensions.Http , Microsoft.Extensions.Logging , Microsoft.Extensions.Logging.Abstractions , Microsoft.Extensions.Logging.Configuration , Microsoft.Extensions.Logging.Console , Microsoft.Extensions.Logging.Debug , Microsoft.Extensions.Logging.EventLog , Microsoft.Extensions.Logging.EventSource , Microsoft.Extensions.Logging.TraceSource , Microsoft.Extensions.Options , Microsoft.Extensions.Options.ConfigurationExtensions , Microsoft.Extensions.Options.DataAnnotations , Microsoft.Extensions.Primitives , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Configuration.ConfigurationManager , System.Diagnostics.DiagnosticSource , System.Diagnostics.EventLog , System.DirectoryServices.Protocols , System.IO.Pipelines , System.Net.Http.Json , System.Net.Http.WinHttpHandler , System.Reflection.Metadata , System.Resources.Extensions , System.Security.Cryptography.Pkcs , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceProcess.ServiceController , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Threading.Channels , System.Threading.RateLimiting
 From Version 7.0.0-preview.6.22281.7 -> To Version 7.0.0-preview.6.22304.5
@captainsafia
Copy link
Member

(Hmm @captainsafia should Swashbuckle move forward to a 6.0.x version too❔ That remains much more version-independent than what we're currently doing in 7.0.x.)

Probably since we made a similar change to NSwag. I've opened a PR at domaindrivendev/Swashbuckle.AspNetCore#2433.

@davidfowl
Copy link
Member

@dougbu Are you asking about newer code or the code we added in .NET 6 to the HostFactoryResolver?

@dougbu
Copy link
Contributor

dougbu commented Jun 6, 2022

@dougbu Are you asking about newer code or the code we added in .NET 6 to the HostFactoryResolver?

I'm asking about the .NET 6 changes though I didn't get the timing of the "additional usings and System.Diagnostics.DiagnosticSource dependency" introduction.

Given the timing, my remaining concern is about interactions w/ "2.1, 3.1" web projects.

…0605.4

Microsoft.Extensions.Caching.Abstractions , Microsoft.Extensions.Caching.Memory , Microsoft.Extensions.Configuration , Microsoft.Extensions.Configuration.Abstractions , Microsoft.Extensions.Configuration.Binder , Microsoft.Extensions.Configuration.CommandLine , Microsoft.Extensions.Configuration.EnvironmentVariables , Microsoft.Extensions.Configuration.FileExtensions , Microsoft.Extensions.Configuration.Ini , Microsoft.Extensions.Configuration.Json , Microsoft.Extensions.Configuration.UserSecrets , Microsoft.Extensions.Configuration.Xml , Microsoft.Extensions.DependencyInjection , Microsoft.Extensions.DependencyInjection.Abstractions , Microsoft.Extensions.DependencyModel , Microsoft.Extensions.FileProviders.Abstractions , Microsoft.Extensions.FileProviders.Composite , Microsoft.Extensions.FileProviders.Physical , Microsoft.Extensions.FileSystemGlobbing , Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Extensions.Hosting , Microsoft.Extensions.Hosting.Abstractions , Microsoft.Extensions.Http , Microsoft.Extensions.Logging , Microsoft.Extensions.Logging.Abstractions , Microsoft.Extensions.Logging.Configuration , Microsoft.Extensions.Logging.Console , Microsoft.Extensions.Logging.Debug , Microsoft.Extensions.Logging.EventLog , Microsoft.Extensions.Logging.EventSource , Microsoft.Extensions.Logging.TraceSource , Microsoft.Extensions.Options , Microsoft.Extensions.Options.ConfigurationExtensions , Microsoft.Extensions.Options.DataAnnotations , Microsoft.Extensions.Primitives , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Configuration.ConfigurationManager , System.Diagnostics.DiagnosticSource , System.Diagnostics.EventLog , System.DirectoryServices.Protocols , System.IO.Pipelines , System.Net.Http.Json , System.Net.Http.WinHttpHandler , System.Reflection.Metadata , System.Resources.Extensions , System.Security.Cryptography.Pkcs , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceProcess.ServiceController , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Threading.Channels , System.Threading.RateLimiting
 From Version 7.0.0-preview.6.22281.7 -> To Version 7.0.0-preview.6.22305.4
@eerhardt
Copy link
Member

eerhardt commented Jun 6, 2022

The combination of additional usings and System.Diagnostics.DiagnosticSource dependency that's not declared in the Microsoft.Extensions.ApiDescription.Server package scares me.

From what I can tell, Microsoft.Extensions.ApiDescription.Server has a ProjectReference to GetDocument.Insider and it "publishes" it:

<Reference Include="dotnet-getdocument"
Condition=" '$(TargetFramework)' == 'netcoreapp2.1' "
Targets="Publish"
Private="false"
ReferenceOutputAssembly="false"
SkipGetTargetFrameworkProperties="true" />
<Reference Include="GetDocument.Insider"
Private="false"
ReferenceOutputAssembly="false"
SkipGetTargetFrameworkProperties="true">
<Targets Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">Publish</Targets>
</Reference>

This means any dependency declared in GetDocument.Insider will be packaged into the nupkg:

image

And it references System.Diagnostics.DiagnosticSource version 4.6.0, which is supported on netcoreapp2.1 and net461. If the app happens to reference a higher version, that version will "win". If it doesn't reference any version, the one in the package is used.

@dougbu
Copy link
Contributor

dougbu commented Jun 6, 2022

And it references System.Diagnostics.DiagnosticSource version 4.6.0, which is supported on netcoreapp2.1 and net461. If the app happens to reference a higher version, that version will "win". If it doesn't reference any version, the one in the package is used.

What would restore System.Diagnostics.DiagnosticSource in the user's app❔ And will everything work correctly even if the app never emits events❔

I'll play more w/ my test apps but have not been able to make them work w/ Microsoft.Extensions.ApiDescription.Server v6.0.5.

and net461

Right, I should have mentioned .NET Framework since we have to support that forever and then some.

@dougbu
Copy link
Contributor

dougbu commented Jun 6, 2022

Completely separately, where are we on the "for the HostFactoryResolver to Type.GetType("Microsoft.Extensions.Hosting.HostAbortedException")" option❔ This PR is now upstream of a few things, including our regular SDK update (#41798).

@eerhardt
Copy link
Member

eerhardt commented Jun 6, 2022

where are we on the "for the HostFactoryResolver to Type.GetType("Microsoft.Extensions.Hosting.HostAbortedException")" option❔

That change is included in dotnet/runtime#70205

…0606.7

Microsoft.Extensions.Caching.Abstractions , Microsoft.Extensions.Caching.Memory , Microsoft.Extensions.Configuration , Microsoft.Extensions.Configuration.Abstractions , Microsoft.Extensions.Configuration.Binder , Microsoft.Extensions.Configuration.CommandLine , Microsoft.Extensions.Configuration.EnvironmentVariables , Microsoft.Extensions.Configuration.FileExtensions , Microsoft.Extensions.Configuration.Ini , Microsoft.Extensions.Configuration.Json , Microsoft.Extensions.Configuration.UserSecrets , Microsoft.Extensions.Configuration.Xml , Microsoft.Extensions.DependencyInjection , Microsoft.Extensions.DependencyInjection.Abstractions , Microsoft.Extensions.DependencyModel , Microsoft.Extensions.FileProviders.Abstractions , Microsoft.Extensions.FileProviders.Composite , Microsoft.Extensions.FileProviders.Physical , Microsoft.Extensions.FileSystemGlobbing , Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Extensions.Hosting , Microsoft.Extensions.Hosting.Abstractions , Microsoft.Extensions.Http , Microsoft.Extensions.Logging , Microsoft.Extensions.Logging.Abstractions , Microsoft.Extensions.Logging.Configuration , Microsoft.Extensions.Logging.Console , Microsoft.Extensions.Logging.Debug , Microsoft.Extensions.Logging.EventLog , Microsoft.Extensions.Logging.EventSource , Microsoft.Extensions.Logging.TraceSource , Microsoft.Extensions.Options , Microsoft.Extensions.Options.ConfigurationExtensions , Microsoft.Extensions.Options.DataAnnotations , Microsoft.Extensions.Primitives , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Configuration.ConfigurationManager , System.Diagnostics.DiagnosticSource , System.Diagnostics.EventLog , System.DirectoryServices.Protocols , System.IO.Pipelines , System.Net.Http.Json , System.Net.Http.WinHttpHandler , System.Reflection.Metadata , System.Resources.Extensions , System.Security.Cryptography.Pkcs , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceProcess.ServiceController , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Threading.Channels , System.Threading.RateLimiting
 From Version 7.0.0-preview.6.22281.7 -> To Version 7.0.0-preview.6.22306.7
@dotnet-maestro dotnet-maestro bot merged commit 7d0e20d into main Jun 7, 2022
@dotnet-maestro dotnet-maestro bot deleted the darc-main-f8b5319a-52c9-4113-9568-5ef9de16586c branch June 7, 2022 14:06
@ghost ghost added this to the 7.0-preview6 milestone Jun 7, 2022
@eerhardt
Copy link
Member

eerhardt commented Jun 7, 2022

FYI - @dougbu - it looks like my change was accepted. Thanks for your feedback, and teaching me something about HostFactoryResolver.

@ghost
Copy link

ghost commented Jun 7, 2022

Hi @eerhardt. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context.

@dougbu
Copy link
Contributor

dougbu commented Jun 7, 2022

@dougbu - it looks like my change was accepted. Thanks for your feedback, and teaching me something about HostFactoryResolver.

I'm so pleased the build after your merge was successful and we didn't even have to deal w/ flaky tests getting this PR in❕ Many thanks for your diligence here and in dotnet/runtime#70205 @eerhardt

Thanks also to @davidfowl

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework Type: Dependency Update 🔼
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants