Cannot I use assembly. Load (PATH). createinstance (classname) on a remote machine )?

Source: Internet
Author: User
The project uses the factory model.
Public static idocument createidocument ()
{
String classname = path + ". documentsqldal ";
Return (idocument) Assembly. Load (PATH). createinstance (classname );
}
This section Code Everything works properly locally,
However, an exception occurs after the same code is remoting:
System. nullreferenceexception: object reference is not set to the instance of the object.
In config.. ctor ()
In config. get_instance ()
In Dal. sqlserver. documentsqldal .. ctor ()
--- End of the internal exception stack trace ---
In system. runtimetypehandle. createinstance (runtimetype type, Boolean publiconly, Boolean nocheck, Boolean & canbecached, runtimemethodhandle & ctor, Boolean & bneedsecuritycheck)
In system. runtimetype. createinstanceslow (Boolean publiconly, Boolean fillcache)
In system. runtimetype. createinstanceimpl (Boolean publiconly, Boolean skipvisibilitychecks, Boolean fillcache)
In system. activator. createinstance (type, Boolean nonpublic)
In system. runtimetype. createinstanceimpl (bindingflags bindingattr, binder, object [] ARGs, cultureinfo culture, object [] activationattributes)
In system. activator. createinstance (type, bindingflags bindingattr, binder, object [] ARGs, cultureinfo culture, object [] activationattributes)
In system. reflection. Assembly. createinstance (string typename)
Why?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.