简体   繁体   中英

dll reference from app.config?

Actually i use references to reference two external dlls for my project. I want to net set up the path in reference but force c# to search for dlls in my application path.

I created a folder in myapp ".netlibs" and put there my dlls and removed them from References section.

I put this in app.config:

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <probing privatePath=".netlibs" />
</assemblyBinding>

But it's not working?

Do u know guys if i miss something?

thanks in advance.

Assembly probing is only available at runtime. At compile time you always need a reference to the external assembly in your project.

What I can understand from your comment is that you are trying to compile your project without the reference.

EDIT after comment: Put the common references in source control, somewhere on a higher level and reference those. If you open your csproj file after you made the reference, the paths should be dynamic, for example: ../../References/MyReference.dll. Every developer should do a get latest of the assemblies.

Another option is to put them in the GAC on every developer machine.

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