I am converting a WPF project from Framework 4.6.2 to .NET 5.0. After I convert (using try-convert without error) and I try to build I get the following:
Error MC1000 Unknown build error, 'Could not find type 'System.Web.PreApplicationStartMethodAttribute' in assembly 'C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0\System.Web.dll'.' MyWPFControlLibrary C:\Program Files\dotnet\sdk\5.0.103\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.WinFX.targets 240
The error is straightforward but I'm not referencing PreApplicationStartMethodAttribute anywhere in my code (at least I don't think I am). It's not an ASP.NET project and I've even tried doing a plain-text search on every file in the project and cannot find anything referencing that, and I don't think it's inherited anywhere. There are two referenced projects in this WPF project but I've already successfully converted both those projects to .NET 5.0.
Any help is appreciated. I've tried every forum post I can find and at this point I'm tempted to just create a new project and copy over each class manually although that would take ages.