简体   繁体   中英

is it possible that an winform app load its dll from path other then the root?

I am including a library in my application, and it's copying 7 dlls with the same path as the exe.

But I want to put these dlls in a sub folder.

When I put the dlls in a subfolder the application doesn't see the dlls.

So is there any configuration that describe where should the application look for its dlls?

Also is it possible to change the location of the referenced dlls that have the copy local attribute set to yes?

Edit:
also relevant is the following question
How can I set PrivateBinPath in MEF?

The runtime will probe for assemblies in the following order:

  1. The Global Assembly Cache (GAC)
  2. The application's working directory

Further probing paths can be set in the app.config file for the application:

http://msdn.microsoft.com/en-us/library/823z9h8w%28VS.80%29.aspx

More information about "How the runtime locates assemblies" can be found here:

http://msdn.microsoft.com/en-us/library/yx7xezcf%28vs.71%29.aspx

Any "policy" for where dependent assemblies are loaded from is controlled by the AppDomain. You can configure other directories to be probed for private assemblies - see AppDomainSetup.PrivateBinPath for a starting point.

Aslo relevant: Question 806383

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM