Could not load type - not obvious

C

ChrisC

Ive been fortunate enough to inherit a vs project that is causing me
problems. It compiles and runs absolutely fine on my development
machine (local), but if I deploy the generated files to one of my other
servers I get 'could not load type x.x' errors. The namespaces and
class names are correct as it works on my local machine and ive checked
them. The bin folder and its contents are all present and correct. Ive
cleared my cache, restarted iis and the aspnet process.... now im
stuck. im going to try reinstalling the .net framework on one of the
servers.

vb.net btw

Help. Ta.
 
P

Patrice

Do you have the same file in your own bin folder. I would say something is
outdated on the target mahcine. In partiuclr note that if youi have unused
files with conflicting types it might welel happens...
 
C

ChrisC

How do i check the contents of the gac? I have deleted the entire
project folder and replaced it on the target machines plenty of
times...

If I reference the project from another one it shows the class with the
expected namespace etc.
 
J

Juan T. Llibre

Go to your "Administrative Tasks" folder in Start Menu, Control Panel,
and run the .NET Framework 1.1, or 2.0, Configuration tool.

It has options to list and manage all the assemblies in the GAC.
 
P

Patrice

What is the type that can't be loaded ? Do you know from the name you see in
which DLL it should be located ?
Use perhaps the VS.NET objet browser to make sure it's available in one of
the files in /bin.

Make sure also it is not available in some other outdated file...

Patrice
 
C

ChrisC

Referencing the class from another project the object browser shows it
all up fine. Basically everything compiles and builds and looks like it
should work. but it doesnt.

The dll is not listed in the gac on the machine on which it works, or
on the target machines. If you try and add it it reports that it must
have a strong name, key and something else.

Still stuck. Thanks for your help so far.
 
C

ChrisC

Still stuck here guys. Ive tried renaming the project etc so it builds
to a different dll but still no joy. I hate hand-me-downs
 
C

ChrisC

Eventually solved - I renamed all the classes and namespaces, removed
the project and solution files and all autogenerated stuff like global
/ assembly. Then created a new solution, project and brought the code
into that. Then it decided it could work. Why? I dont know, but my
money is on there being more potential causes to this 'Could not load
type' stuff than microsoft is willing to admit, and they dont want to
sift through the host of 'i havent compiled my project why doesnt it
work' people who get this error to find genuine problems.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top