I am trying to copy all referenced dll files that my WinForm application is using into single folder called lib. Problem is, that all these dlls are copied into the same folder as executable and app.config file is not copied at all.
I tried everything described in these articles/question:
- C# – How to Reference an Assembly in a Subfolder using App.Config
- Storing your C# Application .dlls in a \lib folder using Visual Studio
- How to move all referenced DLLs into seperate folder in c#?
Here is what my app.config file looks like:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib;libs" />
</assemblyBinding>
</runtime>
</configuration>
On application build/release:
- app.confing file is not copied into debug/release folder
- lib folder is not created
- all referenced dll files are moved into same folder as executable
Once I tried to copy app.config file manually into folder and moved all dll files into lib folder (that I have created) and tried to run application it fails with error: Could not load file or assemby...
What am I doing wrong? Because I can't find out what is wrong and why things are not working.