Thursday, February 14, 2008

Could not load type error in VS 2005 Web Application

Occurring in an existing project

Occasionally I get an error like
Could not load type 'MOS5.MOSLinks'

when editing a web page. I have seen a lot of posts that address this error. For MOS5 it has always come down to case sensitivity.

I end up comparing the existing version to a previous one. Today I noticed that the MOSLinks.aspx.vb had this at the top of the file.

Imports MOS5.mosLinks

I edited this line in MOSLinks.aspx

Inherits="MOS5.MOSLinks"

to this

Inherits="MOS5.mosLinks"

After compiling, the error went away.

Occurring in a newly published project

Make sure the folder you are publishing to is a virtual directory.

No comments: