I have developed an app in WPF using VS 2015. I created a release build for this app. But when I copy this build to any other folder outside it starts properly but does not launch API methods i.e. API hitting methods are not being called or my app is not responding. As it runs properly in debug mode I can't find the reason. Can anybody help?
Asked
Active
Viewed 1,129 times
1
-
Where is the API hosted? Localhost? – Opender Singh Feb 15 '16 at 10:24
-
1Use logging or "attach to process" from VS. More help is simply impossible because of missing code. – JeffRSon Feb 15 '16 at 10:24
-
1Have you copied all dll's from release folder? – StepUp Feb 15 '16 at 10:24
-
@ Opender Singh not API's are live and running. @StepUp I have just copied Application file i.e. exe file from release folder. – Rohit Feb 15 '16 at 10:40
-
Try to copy ALL dll's from the `Release` folder – StepUp Feb 15 '16 at 10:46
-
Copying only exe-file is [not enough](http://stackoverflow.com/q/18933534/1997232). – Sinatr Feb 15 '16 at 11:01
-
Thanks StepUp it worked for me and app is running. But is there no any other way in which I can just copy exe file and use it anywhere? – Rohit Feb 15 '16 at 11:02
1 Answers
1
You should to copy ALL dll's from the Release folder. Your exe
file is dependent on configuration (yourprogram.exe.config) as well as other assemblies (dll's from your folder). Without these dependencies the application cannot run (because that is how .NET works). All classes and methods are wrapped in dll
and if you run your program without some dll
, then it means that there are no necessary classes or its methods which worked with other dll's
in your Visual Studio.
You can use ILMerge to merge all dependencies into single .exe file to simplify distribution of your application.
More detaiils on ILMerge can be found here: ILMerge on CodeProject

StepUp
- 36,391
- 15
- 88
- 148
-
2This is exactly what I needed and second part resolves my problem. Thanks – Rohit Feb 15 '16 at 12:28