Elahe
Elahe

Reputation: 1399

how to change dll directory in C# project

I used a dll in my C# project that its Directory is exactly in same location of exe file. so when I install my project, the dll file will be locate in exe Directory.

is there any way that I change dll Directory? for example the dll file locate in this: bin\DLLs. I dont want that user know about my dll easily.

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

Thanks.

Upvotes: 1

Views: 1846

Answers (2)

Elahe
Elahe

Reputation: 1399

I wanted to change dll directory that users cant see them. So I try to load DLL from Embedded Resource. its a good idea that workes for me.

by this way, you can change your exe file with out any related dll.

see here for more detailes

Upvotes: 0

Robert
Robert

Reputation: 2506

You can install your dll's in GAC to "hide them". But it won't hide them from a skilled user.

Upvotes: 2

Related Questions