C # creating ".exe" with libraries

I am using some dlls in my project. To make the .exe file, I used only "Released" in the solution configurations. On my computer, the exe file works, but in another there is an error: "Unable to load file X ...". X is the dll file. How can I solve this problem? I copied all the dlls to project-bin-realese.

+3
source share
3 answers

Copy the DLLs to the same folder as the EXE. You put them in a subdirectory, then you have to use the element <probing>in the app.exe.config file so that the CLR can find them.

+1
source

DLL, "" . , EXE.

+1

The above answers are common for loading dependency libraries. However, this may also depend on how exe loads the libraries. For example, MEF has a DI mechanism for loading directory libraries from a specific folder. If the required libraries are not there, you can get a similar exception. Check your .exe requirements for its specific dependencies.

0
source

Source: https://habr.com/ru/post/1780302/


All Articles