Skip to content

Retarget the .NET Framework examples to net481 - #36

Merged
tillig merged 3 commits into
mainfrom
feature/retarget-net481
Sep 1, 2026
Merged

tillig merged 3 commits into
mainfrom
feature/retarget-net481

Conversation

@tillig

@tillig tillig commented Sep 1, 2026

Copy link
Copy Markdown
Member

Part of #32

Proposed Changes

  • All six .NET Framework examples move from net472 to net481. This wasn't optional: the integration packages target net481 as of their latest releases, so net472 couldn't take them.
  • Autofac 6.5.0 → 9.3.2, plus Autofac.Mvc5 7.0.0, Autofac.Wcf 8.0.0, Autofac.Web 8.0.0, Autofac.Owin 8.0.0, Autofac.WebApi2 7.0.0, Autofac.WebApi2.Owin 7.0.0, Autofac.Multitenant 9.0.1, Autofac.Multitenant.Wcf 7.0.0. ASP.NET MVC, Razor, WebPages, OWIN self-host, and Newtonsoft.Json also move to current.
  • Binding redirects corrected: Microsoft.Bcl.AsyncInterfaces → 10.0.0.11, System.Threading.Tasks.Extensions → 4.2.4.0, System.Web.Mvc → 5.3.0.0.
  • Autofac gets a binding redirect it never had. Every integration package is compiled against Autofac 9.3.1.0, and these projects now load 9.3.2.0. On .NET Framework that mismatch is fatal, and web projects get no auto-generated redirects the way the self-host exe does. Without this the five web apps throw at startup.
  • Second commit adds a Microsoft.Web.Infrastructure redirect. This one predates the retarget — System.Web.Mvc, System.Web.Optimization, and System.Web.WebPages all reference 1.0.0.0 while 2.0.0.0 ships in bin. It's split out so it's reviewable on its own, but leaving it would mean three examples still don't start.

How the redirect versions were determined

Not by guessing. I read the assembly versions out of the built output with System.Reflection.Metadata, walked every AssemblyRef in each project's bin, and flagged each reference whose version differs from the assembly actually shipping alongside it. That produced the required redirect set per project, which I then verified against the Web.config files. As a cross-check, the values match what MSBuild auto-generated for WebApiExample.OwinSelfHost.exe.config, which is the one project that gets redirects for free.

Existing redirects for System.Web.Helpers, System.Web.WebPages, WebGrease, and Antlr3.Runtime were left alone. Static analysis says they're currently satisfied, but runtime Razor view compilation can need them and that isn't visible from the build output.

What is and isn't verified

All six projects build clean in Release with zero warnings, and both gates pass.

No runtime verification was possible. These are .NET Framework web and self-host apps; they can't run on macOS, and CI only builds. Everything above about redirects is derived from assembly metadata rather than observed at startup, which is exactly why I computed it instead of eyeballing it — but a real startup test on Windows is the only thing that proves it. Worth a spot-check by someone who can run one of the web examples under IIS Express before this is trusted.

The integration packages target net481 as of their latest releases, so net472
could not take them. Autofac 6.5.0 to 9.3.2 across all six projects, plus
Autofac.Mvc5 7.0.0, Autofac.Wcf 8.0.0, Autofac.Web 8.0.0, Autofac.Owin 8.0.0,
Autofac.WebApi2 7.0.0, Autofac.WebApi2.Owin 7.0.0, Autofac.Multitenant 9.0.1,
and Autofac.Multitenant.Wcf 7.0.0. ASP.NET MVC, Razor, WebPages, OWIN, and
Newtonsoft.Json also move to current.

Three binding redirects had to move with them. Microsoft.Bcl.AsyncInterfaces
goes to 10.0.0.11, System.Threading.Tasks.Extensions to 4.2.4.0, and
System.Web.Mvc to 5.3.0.0. Autofac needs a redirect it never had: every
integration package is compiled against 9.3.1.0 while these projects now load
9.3.2.0, and web projects get no auto-generated redirects the way the self-host
exe does. Without it the apps throw at startup, and a build-only CI would never
notice.

Redirect versions were read from the built output rather than guessed, and
cross-checked against what MSBuild generated for WebApiExample.OwinSelfHost.

Part of #32
System.Web.Mvc, System.Web.Optimization, and System.Web.WebPages all reference
Microsoft.Web.Infrastructure 1.0.0.0, but 2.0.0.0 is what ships in bin. The
mismatch predates the net481 retarget; it surfaced while computing which
redirects the retarget needed, and leaving it would keep these three examples
from starting.

Part of #32
@tillig tillig mentioned this pull request Sep 1, 2026
9 tasks done
Appending new entries left each assemblyBinding in insertion order, and it was
already unsorted before that: System.Web.Mvc sat after System.Web.WebPages, and
WebGrease ahead of Antlr3.Runtime. Alphabetical means the next addition has an
obvious home instead of landing at the bottom.

Reordering only; the entries themselves are unchanged.

Part of #32
@tillig
tillig merged commit 55d8ab5 into main Sep 1, 2026
8 checks passed
@tillig
tillig deleted the feature/retarget-net481 branch September 1, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant