posted on Saturday, January 22, 2005 6:55 AM
by
roydictus
"Parser Error Message: Could not load type" revisited
Remember my previous post about how Visual Studio.Net ruined my day? The story didn't end there...
Because the next day, the problem came back. Everyone on the team was suffering from it, it was spreading like wildfire. That's the disadvantage of source code control I guess :-)
But after a lot of swearing, sweating, bleeding, and a lot of other unpleasant things, we found the actual cause of the problem -- never mind the fact that, in the case of a Parser Error with Global.asax.vb, you could solve the problem by adding a space to the source code, saving, compiling and repeating...
The cause of the Parser Error which kept cropping up, everywhere in the project, was inconsistent use of namespace casing (in my defense, I joined this project very late and the codebase didn't use the proper naming conventions.) That is, a number of .aspx files would contain an "Inherits" attribute which contained proper Pascal casing for the namespace, whereas the project settings would not:
<%@Page Language="vb" ... Inherits="Company.Project.UI.Web.MyPage.aspx.vb" ... %>
and
project settings' Default Namespace: Company.PROJECT.UI.Web
This inconsistency caused Visual Basic.Net to totally lose it and go nuts on us. The solution was to have everyone check in their code, and let an appointed "volunteer" do a complete Checkout, find/replace all occurrences of the capitalized word by the Pascal-cased word, update the necessary file and directory names, delete the IIS Virtual Directory and create a new one, recompile and check everything back in. The Cleanup utility was a tremendous help here (of course :-)).
So try this first before you strangle anyone! (I sincerely apologize to my victim's family and friends. I feel their pain...)