I’m in the process of refactoring an existing ASP.NET 4 (MVC/Web API) application to .NET Core. After updating the project structure and dependencies, I’m running into errors during build/runtime.
Steps to Reproduce:
Migrate ASP.NET 4 project to .NET Core 6
Update csproj and NuGet dependencies
Try to run the app with dotnet run
Expected Behavior:
Project builds and runs successfully in .NET Core environment.
Actual Behavior:
Build fails with errors such as:
error CS0234: The type or namespace name 'Configuration' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Or runtime error:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Web'
Environment:
Original Framework: .NET Framework 4.7.2
Target: .NET 6
OS: Windows 11
Additional Context:
Looks like many System.Web.* APIs are not available in .NET Core.
I’m in the process of refactoring an existing ASP.NET 4 (MVC/Web API) application to .NET Core. After updating the project structure and dependencies, I’m running into errors during build/runtime.
Steps to Reproduce:
Migrate ASP.NET 4 project to .NET Core 6
Update csproj and NuGet dependencies
Try to run the app with dotnet run
Expected Behavior:
Project builds and runs successfully in .NET Core environment.
Actual Behavior:
Build fails with errors such as:
error CS0234: The type or namespace name 'Configuration' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)Or runtime error:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Web'Environment:
Original Framework: .NET Framework 4.7.2
Target: .NET 6
OS: Windows 11
Additional Context:
Looks like many System.Web.* APIs are not available in .NET Core.