VS2010 web app could not load type 'usercontrol'


I have a VB.Net 2.0 (created in VS2003 and migrated to VS2005) web app which has been working with no issue. When I moved the code to VS2010, it complied. But as I run the app, it gives me the error 'Could not load type "MyNS.MyNS.MyType"'
<%@ Application Language="VB" CodeBehind="Global.asax.vb" Inherits="MyNS.MyNS.MyType" %>

Open in new window


Anyone has idea what causes this and how to fix this?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

have you tried changing Inherits to MyNS.Global_asax?  At least it should match the public class name i believe.
KingstonDeveloperAuthor Commented:
Thanks Padre for your reply. This application was created in earlier version of VS and .Net so it doesn't have Site.Master page. What I did in VS2010 was create new empty web application, then add all the files and folders from the old project. It compiled successfully. The Public Class in the Global.asax.vb file is as followed:

Imports System.Web
Imports System.Web.Security

Namespace MyNS
    Public Class MyType
        Inherits System.Web.HttpApplication
        Sub Application_Start(...)
        End Sub
    End Class
End Namespace

Open in new window

KingstonDeveloperAuthor Commented:
Okay, I finally have to recreate new Asp.Net App.
Then, manually copied the code from the old Global.asax.vb file and pasted it in the new Global.asax.vb file. Renamed the Inherits="Global_asax" to my public class in Global.asax.vb file and Wah.Lah.  The problem went away.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
KingstonDeveloperAuthor Commented:
I solved this myself
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.