Upgrade IIS NewShim tests from 2.2 packages to shared framework#66332
Draft
wtgodbe wants to merge 7 commits intodotnet:mainfrom
Draft
Upgrade IIS NewShim tests from 2.2 packages to shared framework#66332wtgodbe wants to merge 7 commits intodotnet:mainfrom
wtgodbe wants to merge 7 commits intodotnet:mainfrom
Conversation
Replace 2.2.0 PackageReferences in InProcessNewShimWebSite with shared framework References to fix TypeLoadException on .NET 11+ caused by PackageOverrides.txt (dotnet/dotnet#5206) overriding old Microsoft.Extensions.* assemblies. The old packages referenced types (e.g. NullScope) that were removed in later versions, causing TypeLoadException when the shared framework forces the v11 assembly. Also reverts the test quarantine from dotnet#66239 since the root cause is now addressed. Changes: - InProcessNewShimWebSite.csproj: Replace 9 PackageReferences (2.2.0) with shared framework References - IIS.NewShim.FunctionalTests.csproj: Remove internal-build skip/exclude (no more vulnerable packages) - NewShimTests.cs: Relax ANCM version assertion (no longer pinned to 2.2-era version) - ShutdownTests.cs, StartupTests.cs: Remove quarantine annotations added in dotnet#66239 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the IIS NewShim functional test app and tests to avoid .NET 11+ PackageOverrides.txt type-loading failures caused by restoring legacy 2.2-era Microsoft.Extensions.* packages, while keeping the NewShim scenario coverage.
Changes:
- Replace 2.2
PackageReferencedependencies inInProcessNewShimWebSitewith shared-framework assembly references. - Remove internal-build skip/exclude flags now that vulnerable package restores are no longer needed.
- Loosen the in-process handler version assertion and unquarantine related IIS long tests for the NewShim configuration.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Servers/IIS/IIS/test/testassets/InProcessNewShimWebSite/InProcessNewShimWebSite.csproj | Removes 2.2 package restores and switches to assembly references to avoid PackageOverrides.txt conflicts on .NET 11+. |
| src/Servers/IIS/IIS/test/IIS.NewShim.FunctionalTests/IIS.NewShim.FunctionalTests.csproj | Stops skipping/excluding NewShim tests in internal builds. |
| src/Servers/IIS/IIS/test/IIS.NewShim.FunctionalTests/NewShimTests.cs | Removes hard-coded ANCM module version pin; validates presence instead. |
| src/Servers/IIS/IIS/test/Common.LongTests/StartupTests.cs | Removes NewShim-specific quarantines now that the underlying failure is addressed. |
| src/Servers/IIS/IIS/test/Common.LongTests/ShutdownTests.cs | Removes NewShim-specific quarantines now that the underlying failure is addressed. |
The InProcessNewShimWebSite compiles shared source from InProcessWebSite which uses Microsoft.AspNetCore.Authentication, HttpSys, WebSockets, etc. The old 2.2 packages pulled these in transitively; with shared framework References we need to list them explicitly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
FORWARDCOMPAT blocks intentionally use old APIs (IHostingEnvironment, IApplicationLifetime, IHttpBufferingFeature) to exercise legacy code paths. These were not marked obsolete in the 2.2 packages but are in the current shared framework. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
IAuthenticationSchemeProvider is in Authentication.Abstractions, needed by Startup.cs shared code. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add Kestrel.Transport.NamedPipes, Kestrel.Transport.Quic, and Extensions.Http to match the full InProcessWebSite reference set. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
IHttpBufferingFeature was removed from the shared framework. Use the modern IHttpResponseBodyFeature.DisableBuffering() for both FORWARDCOMPAT and non-FORWARDCOMPAT code paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace 2.2.0
PackageReferenceitems inInProcessNewShimWebSitewith shared frameworkReferenceitems to fixTypeLoadExceptionon .NET 11+ caused byPackageOverrides.txt(dotnet/dotnet#5206).Problem
PR dotnet/dotnet#5206 added
Microsoft.Extensions.*.Abstractionspackages to the shared framework'sPackageOverrides.txt. When old code (compiled against M.E.Logging 2.2.0) runs on .NET 11, the shared framework overridesMicrosoft.Extensions.Logging.Abstractionswith v11.x. The oldLogger.BeginScope()referencesNullScope— a type that was public in v2.2 but removed in v3.0 — causingTypeLoadException.Repro: https://github.com/wtgodbe/package-overrides-typeload-repro
Changes
InProcessNewShimWebSite.csproj: Replace 9PackageReferenceitems (2.2.0) with shared frameworkReferenceitems. RemoveExcludeFromBuildfor internal builds (no more vulnerable packages).IIS.NewShim.FunctionalTests.csproj: Remove internal-buildSkipTests/ExcludeFromBuild(no more vulnerable packages).NewShimTests.cs: Relax ANCM version assertion from hard-coded12.2.19169.6toAssert.NotNull(no longer pinned to 2.2-era ANCM).ShutdownTests.cs,StartupTests.cs: Remove[QuarantinedTest]annotations added in [main] Source code updates from dotnet/dotnet #66239 since the root cause is now addressed.Notes
FORWARDCOMPATdefine is kept so the test app continues to exercise old-styleWebHostBuildercode paths.IIS.NewHandler.FunctionalTestsis not touched — it referencesMicrosoft.AspNetCore.AspNetCoreModuleV2 2.2.0(a native ANCM package, different failure mode).