4

Recently I upgrade my .net 4.8 web project to .net 6. Post upgrade I am getting below error from Global.asax.cs page

public class MvcApplication : HttpApplication

CS0246 The type or namespace name 'HttpApplication' could not be found (are you missing a using directive or an assembly reference?) ~project path\Global.asax.cs

I have tried few possible way to fix this issue, but no luck

It seems like issue is with System.Web namespace in .Net 6. I am getting maximum error because of System.Web namespace

What I can see in .net 6.0 only one class is present in System.Web that is “HttpUtility”. Refer this https://learn.microsoft.com/en-us/dotnet/api/system.web?view=net-6.0

But for System.Web in .Net Framework 4.8 many class was there. Refer this. https://learn.microsoft.com/en-us/dotnet/api/system.web?view=netframework-4.8

Can anyone please help me to understand the issue or any possible way or namespace we can use to fix this

1
  • There has been a fundamental change in how web applications work in .NET Core. So this migration is not gonna be painless, unfortunately. Commented Jun 2, 2022 at 0:32

1 Answer 1

1

It seems you have an ASP.NET application. ASP.NET is a framework that runs under .NET Framework only.

It is not compatible with .NET 6.0 (or any .NET Core and later versions). A new framework replaces ASP.NET for .NET (.NET Core): ASP.NET Core.

ASP.NET Core is a redesign of ASP.NET.

While both framework share some common concepts, they are different frameworks. This page list the differences between the two frameworks.

Some extensive changes might be needed in order to convert an ASP.NET project to an ASP.NET Core project.

As pointed out by @NPras, a migration guide is issued by Microsoft to provide guidance in such a task.

Sign up to request clarification or add additional context in comments.

1 Comment

This doesn't answer the question, which is about what to use in ASP.NET Core in place of the HttpApplication class and methods from ASP.NET classic. The suggested migration guide also provides no help on this subject.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.