Could not load type - TypeLoadException problem

Posted on 2006-05-16
Last Modified: 2008-01-09
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=, Culture=neutral, PublicKeyToken=null'.

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

Question by:gromul
    LVL 11

    Assisted Solution

    could you please provide a litle more info?
    such as: what is the code that try to load the class2?
    how is class2 defined...

    LVL 9

    Accepted Solution

    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.


    Author Comment


    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    return array from dll 13 21 mvc 2 30
    Need Regex Money No $ 5 44
    need help calling an external function within c# 1 19
    Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
    Article by: Najam
    Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now