Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1032
  • Last Modified:

Could not load type - TypeLoadException problem

I have two projects in one solution and I reference project 2 from project 1.

The code compiles, but when I try to run it, I get the following unhandled TypeLoadException:

System.TypeLoadException was unhandled
Message: Could not load type 'MyNamespace.Class2' from assembly 'Class1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.

Any ideas what could be causing this and how to solve it?

Thanks!
0
gromul
Asked:
gromul
2 Solutions
 
AgariciCommented:
could you please provide a litle more info?
such as: what is the code that try to load the class2?
how is class2 defined...

A.
0
 
WinterMuteUKCommented:
Hey Gromul,

one thing to try is to delete all the dll's/exe's in the bin directories (You could just delete the Bin directories, or in VS2005 rightclick on the solution and say - Clean Solution).

Then try compiling and running.

I've had this issue when I had an older version of a dll in the wrong place, generally when I renamed a dll for example.

Cheers
Wint
0
 
gromulAuthor Commented:
Thanks
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.

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