Tech Off Thread

2 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

TypeLoad exception, when using GetType

Back to Forum: Tech Off
  • User profile image
    Chadk

    Hi.

    Im trying to load an assembly(In code), and get a type from it.

    I do it in this way:

    AppDomain.CurrentDomain.Load(serviceassembly.GetName);
    host = New ServiceHost(Type.GetType(node.Attributes("name").InnerText,True, True));
    
    
    But the last line, throws me this exception: System.TypeLoadException was unhandled Message="Could not load type Service.Service1' from assembly Service, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'."
    Anyone ever encountered this? Or can see what im doing wrong?

    Cheers

  • User profile image
    codewiz

    Check to ensure that your "name" attribute is the fully qualifed namespace for the class you are trying to load.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.