• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 979
  • Last Modified:

VS2010 web app could not load type 'usercontrol'

Hello,

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?

Thanks
0
KingstonDeveloper
Asked:
KingstonDeveloper
  • 3
1 Solution
 
Padre_CorleoneCommented:
have you tried changing Inherits to MyNS.Global_asax?  At least it should match the public class name i believe.
0
 
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

0
 
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.
0
 
KingstonDeveloperAuthor Commented:
I solved this myself
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now