could not load a file or assembly

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • swarupbit
    New Member
    • Aug 2007
    • 2

    could not load a file or assembly

    hi all,
    i have developed a windows application which requies to get the types of the dll files.
    After loading the file path when i try to get the type of that dll,i am getting an error as {"Could not load file or assembly or one of its dependencies. The system cannot find the file specified"}. this error i am getting after handling the loader exception.

    Assembly asm = Assembly.LoadFi le(strFilePath) ;
    Type[] types = asm.GetTypes();
    return types;

    this is the piece of code which i am implementing.An yone having any idea on this.
    i need the answer badly as i am stuck in it,i tried searching out but all in vain.
    plz help.

    thanks.
    swarup
  • jigsmshah
    New Member
    • Aug 2007
    • 14

    #2
    Hope u have the reference of that DLL in ur project.I was also trying to load the DLL dynamically and was getting the same error.
    I had used the code that i had mentioned below.hope by adding reference u will be able to solve the problem.Do let me know
    Regards
    Jignesh

    Type type = Type.GetType(Sy stem.Configurat ion.Configurati onSettings.AppS ettings["ClassTypeMSAcc ess"]);
    INorthWindDataF actory iobj=Activator. CreateInstance( type,null);

    Comment

    Working...