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

Move IServerVariablesFeature to Http.Features #10374

Conversation

mderriey
Copy link
Contributor

  • Move IServerVariablesFeature to Http.Features and forward in Servers.IIS
  • Create GetServerVariable in Http.Extensions
  • Mark GetIISServerVariable obsolete in Servers.IIS

Addresses #10167

@Tratcher
Copy link
Member

Tratcher commented May 19, 2019

"You might need to regenerate the reference assemblies ... see docs/ReferenceAssemblies.md"
Microsoft.AspNetCore.Http.Features.netstandard2.0.cs

@mderriey
Copy link
Contributor Author

Oh sorry about that, I thought I did for the projects which changed. I'll do it globally as I must have missed something.

Thanks.

@mderriey mderriey force-pushed the 10167-move-iservervariables-feature-around branch from 1b8d904 to 31eeab5 Compare May 19, 2019 10:13
@mderriey
Copy link
Contributor Author

mderriey commented May 20, 2019

Errors in the latest builds

F:\workspace\_work\1\s\src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs(37,44): 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' [F:\workspace\_work\1\s\src\Servers\IIS\IIS\test\testassets\InProcessForwardsCompatWebSite\InProcessForwardsCompatWebSite.csproj]
F:\workspace\_work\1\s\src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs(705,58): 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' [F:\workspace\_work\1\s\src\Servers\IIS\IIS\test\testassets\InProcessForwardsCompatWebSite\InProcessForwardsCompatWebSite.csproj]
F:\workspace\_work\1\s\src\Servers\IIS\IIS\samples\NativeIISSample\Startup.cs(83,72): error CS0618: 'HttpContextExtensions.GetIISServerVariable(HttpContext, string)' is obsolete: 'This is obsolete and will be removed in a future version. Use GetServerVariable instead.' [F:\workspace\_work\1\s\src\Servers\IIS\IIS\samples\NativeIISSample\NativeIISSample.csproj]

I believe updating samples to use the new GetServerVariable method will fix the 3rd one.
I'm not too sure what needs to be done to fix the first two, though. I've never done type-forwarding before, so maybe I did it wrong?

Edit: Ah! I guess it might be there's 2 using directives and the compiler doesn't know which IServerVariablesFeature type to resolve to. Still a bit puzzled that there's 2.2 and 3.0 versions mixed up, but I'll see if being explicit fixes it

Edit #2: Found out why the versions being mixed up; it's because of InProcessForwardsCompatWebSite.

@Tratcher
Copy link
Member

@jkotalik It's pretty strange that InProcessForwardsCompatWebSite mixes package versions like that. It should be all 2.2 or all 3.0.

@mderriey
Copy link
Contributor Author

How dumb!

They both live in the same namespace so my attempt to differentiate one from the other via namespaces obviously didn't work.

@jkotalik
Copy link
Contributor

jkotalik commented Jun 7, 2019

@mderriey I'm going to take a stab at fixing the namespace resolution issue you are hitting.

@jkotalik
Copy link
Contributor

jkotalik commented Jun 7, 2019

Closing in favor of my new PR (as I couldn't push to your fork without cloning).

@jkotalik jkotalik closed this Jun 7, 2019
@amcasey amcasey added area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants