Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# application says "No" when executed

I have developed a small-ish C# console application (TextMatcher.exe) on my local development machine and now need to deploy it to the live environment. It references another class library which I developed which has generic functions, which I intend to use and improve in future console applications.

Ultimately this specific application will be executed from within an SSIS package, but for now I'm just trying to run it from cmd.

I kid you not that this is the actual output from the program:

E:/TextMatcher>TextMatcher.exe
No

E:/TextMatcher>

The computer literally says "No" and gives no further information. I have not included, anywhere in the program, to output the word "No", on any failure or otherwise.

Of course, it runs fine locally. I made sure I included the dll of the utility class library too. I have read other questions (here, here) about how to deploy console apps correctly, and have followed the advice.

NB: This is also proving to be quite hard to Google because of the use of the word "No" being fundamental to the problem...

EDIT - It seems to be working now... I simply copied over the files again from my local machine to the remote machine... I am trying to get it to break again so that I can figure out what on Earth happened, and until I do, I will not accept an answer so that people could maybe shed some more light onto it. Either way it is quite baffling.

like image 939
Arj Avatar asked Oct 08 '22 04:10

Arj


2 Answers

There's a chance that someone has modified the Image File Execution Options registry setting on the server to launch a debugger automatically.

In short, examine the registry key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\currentversion\image file execution options and see if there's an entry that matches the name of your executable.

like image 133
Rob Avatar answered Oct 13 '22 12:10

Rob


Check whether you have installed the necessary Framework components, i.e. the suiting Dot net framework. Application with 4.0 and installed 3.5 can cause very strange behaviour.

Try writing a very simple window application and start it on the deployment machine (this will give you probably more help what is missing).

Check whether the needed Dlls (that you developed, e.g. your class library) are reachable for the console application. And check whether the right version of your Dll is matched!

Check the plattform settings in your console application. Do they match with the machine where you want to run your application? (win64 and win32 mismatch)

If all of those do not help, try inspecting your executable on the deployment machine for example with depends.net, checkasm, or similar.

like image 26
Mare Infinitus Avatar answered Oct 13 '22 11:10

Mare Infinitus