One kind of error opening codebehind file in Visual Studio.NET 2003 (solved)

G

google

Hi,

after fighting with an issue in Visual Studio.NET 2003 in aspx, I've
finally figured out what it is and maybe you might find it usefull.

Symptoms:

When you try to open a .aspx or related file (like a usercontrol) you
receive the message:
"The class file "WebForm1.aspx.cs" specified as the codebehind for
"WebForm1.aspx" could not be loaded. Make sure that the codebehind
attribute
in the page or control directive properly references an existing code
behind
file"

My error was:

This is an error message coming directly from the Visual Studio
Envrionment, not any IIS or asp_net thing and can only happen in a
multi-language scenario. I originally had the German Version of Visual
Studio.NET 2003 installed. I then removed that version and installed
the English Version. Unfortunately not all original German Version
things were removed with the result that I had a English-German
mish-mash. Everything worked fine except when locale related things
were accessed.
One case is when you try to open an aspx page. It accesses the
'VS2003\VC#\Designer Templates' Directory and in there is either a 1031
(for german) or 1033 (for english). I have 1033 installed but somewhere
the system still believes it's german and tries to go for 1031 - which
of course it can't find. That in turn causes the error.

Solution:

Unfortunately as far as I can tell, the only solution for that error is
to completely deinstall VS.NET and make sure that everything is
removed. That includes:

Making sure the registry is clean with:

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\7.1
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1

making sure the dirs are gone:

The installation directory for VS.NET.

..\Documents and Settings\[USERNAME]\Local Settings\Application
Data\Microsoft\VisualStudio

.\Documents and Settings\[USERNAME]\Application
Data\Microsoft\VisualStudio

c:\program files\microsoft visual studio .Net

Once that all is removed and you re-install your VS.NET 2003, things
should be working again. Of course using a locale as part of a
directory isn't exactly the best idea, but there you go...

Greetings,
Eduard Ralph
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top