0

so I made this app, there is DLLs, conf files and 1 conf file that need to be modified by the user.

After doing some research I learned that an ready exe file was in bin/debug.

However in bin/debug I have :

debug
---conf.ini
---stuff.xml
---dll1.dll
---dll2.dll
---myExe.exe
---myExe.exe.config
---myExe.pdb
---myExe.vshost.exe
---myExe.vshost.exe.config
---myExe.vshost.exe.manifest
---etc

I'd like to end up with something like :

debug
---conf.ini
---myExe.exe
---Depandancies
------stuff.xml
------dll1.dll
------dll2.dll
------myExe.exe.config
------myExe.pdb
------myExe.vshost.exe
------myExe.vshost.exe.config
------myExe.vshost.exe.manifest
------etc

Is this possible?

Thanks.

Ps : I'm using VS2013 and coding in .net 4.5.1

sliders_alpha
  • 2,276
  • 4
  • 33
  • 52
  • 1
    Possible duplicate of [Set Custom Path to Referenced DLL's?](http://stackoverflow.com/questions/1892492/set-custom-path-to-referenced-dlls) – Manfred Radlwimmer Nov 04 '16 at 10:57
  • @ManfredRadlwimmer well it's not only dlls, but also myExe.vshost.exe.manifest that need to be in the depandancies folder. – sliders_alpha Nov 04 '16 at 11:01
  • 1
    The CLR absolutely hates this practice, it is very sulky about solving DLL Hell problems. The only good solution is to not have to solve it. It is not impossible, you have to edit the .config file and add the probing element. But the .config file must be in the same directory as the exe. And there is no point in shipping the .vshost files, that's a debugging detail. Don't do it. – Hans Passant Nov 04 '16 at 11:02
  • *dependencies*, and you don't need the vshost.exe or its manifest. – Manfred Radlwimmer Nov 04 '16 at 11:02
  • @HansPassant The config is only one option, I like to overwrite the `AssemblyResolve` of my `AppDomain` so I have full control over where dlls come from. Any directory structure is possible and if needed, only the exe is in the top directory. – Manfred Radlwimmer Nov 04 '16 at 11:05
  • 1
    The best code that is *guaranteed* to not have any bugs is code that isn't written. Lots of ways to fumble that event. And for somebody to break it, all they have to do is copy a file into the right place. Presto chango, nasty DLL injection bug. – Hans Passant Nov 04 '16 at 11:09
  • Do I need to reorganize everything once I added the probing to my App.config? or is this suposed to generate it? because it's doing nothing – sliders_alpha Nov 04 '16 at 11:22

0 Answers0