2

I've completed a C# program which uses winforms and Microsoft.Speech (both recognition and synthesis) library, built it and it runs fine on the same computer. However when I copy the whole application directory to another computer the program starts and shuts down immediately.

Things I have tried:

  • Main method has a try-catch which prints all exceptions. I've tried running the both straight from the directory and command line, both resulting identically the program closing immediately without any exceptions thrown
  • I've checked that the computer I'm trying to run the executable on has the correct version of .NET framework (my executable uses 4.5.2 and the computer states it already has a newer version)

  • I've also downloaded the Microsoft.Speech libraries on the new computer, no effect

Obviously I have gone wrong about the whole deployment task here. Most of the beginner guides suggest using the Setup and Deployment project template, but that is no longer supported in Visual Studio. As this is a whole new area of programming to me I'm now completely lost on how to proceed. Please help.

  • Have you tried checking the Windows Event Viewer to get a better understanding of what's happening? – ccalboni Jul 06 '17 at 11:45
  • Did you check the Event Viewer in windows for application error logs? – Suraj S Jul 06 '17 at 11:46
  • Enable fusion log and check there what is missing. https://stackoverflow.com/questions/255669/how-to-enable-assembly-bind-failure-logging-fusion-in-net – Vladimir Arustamian Jul 06 '17 at 11:46
  • Fusion log doesn't seem to log anything for me (I followed the instructions on your link to a point). Event Viewer captured the application throwing Exception code: 0xe0434352 and Faulting module name: KERNELBASE.dll. Apparently the exception is for all .NET exception. Gonna try installing Visual Studio on the new computer to debug there. – NikeTheSword Jul 06 '17 at 12:30

1 Answers1

0

add a try{}(Exception ex)catch{} statement and within the catch statement you write the ex.toString() to a file, so you can read the error.

CorrupD
  • 36
  • 6