-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Move IServerVariablesFeature to Http.Features #11007
Conversation
Re: type conflict. Given that Microsoft.AspNetCore.Http.Features is both shared framework and in a nuget package, it's conceivable a customer could run into issues. I believe the only reason Http.Features is a package is because the SignalR 3.0 client uses it. One idea: cross-compile Microsoft.AspNetCore.Http.Features for netcoreapp3.0, and exclude the IServerVariablesFeature when building for netstandard2.0. cc @davidfowl |
@natemcmaster the type conflict was caused by referencing 2.2 and 3.0 AspNetCore assemblies from the same application which as a rule we do not support. I asked him to change the backcompat test asset project to use only AspNetCore 2.2 dependencies and that fixed the issue. |
Hmm, Helix didn't like this.
That's an understandable assumption on Helix's part. Any way to override it? |
Hmm this is an interesting problem, we may need to move IFeatureCollection to a lower assembly and type forward. |
As @Tratcher mentioned, this conflict was only occurring due to this test site referencing 2.2 and 3.0 assets. Doing that hasn't been a problem up until now.
IIRC this was the main reason I was hesitant on making this change: we don't target the 2.2 tfm anywhere else. @aspnet/build thoughts? |
@jkotalik could you use netcoreapp3.0? It's primarily the 2.2 package dependencies that matter here, no? |
Because of this conflict, am not able to get IServerVariablesFeature in .net standard 2.0/2.1 and available in core app 3.0+ ? |
ASP.NET Core 3.x is .NET Core only. See https://docs.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.1&tabs=visual-studio#migrate-libraries-via-multi-targeting |
IServerVariablesFeature
toHttp.Features
and forward inServers.IIS
GetServerVariable
inHttp.Extensions
GetIISServerVariable
obsolete inServers.IIS
Addresses #10167
(ported from #10374)
@aspnet/build big question for you. We have a scenario with IIS tests that require us to test a 2.2 app with a new ASP.NET Core Module. Before, this app was taking a single dependency from 2.2 (Microsoft.AspNetCore.Server.IIS). With this change, there was a type conflict
error CS0433: The type 'IServerVariablesFeature' exists in both 'Microsoft.AspNetCore.Http.Features, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' and 'Microsoft.AspNetCore.Server.IIS, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
where two types with the same name existed in the same namespace. Instead of trying to resolve that, I did the "right" thing and made app actually target netcoreapp2.2. However, I'd imagine this could be a build nightmare (though I don't care about updating the versions). What are your thoughts?