Console application - unable to catch unused exception

I wrote a very simple C # Console application that will open a Crystal Report, update it and save it as a PDF to a specified location.

Everything works fine when running in VS2005; the pdf file is generated as expected. When I copy the .exe file to my root C: drive and run it from the command line, I get a dialog box saying "CrystalGenerator has stopped working" but the PDF file is still generated! Looking for the possible causes of this dialog indicates that an unhandled exception has occurred, but all the contents of the main method are contained in try / catch, so this might not be my problem.

I see several entries in the event log that say "The substitution string for index insert (% 1) could not be found" but cannot find a reasonable explanation of what this means.

The upside is that if I copy the file to the box that the 2003 server is running (where it is meant to run) the command runs without error - but I want to know why the application does not perform well in Vista and how to resolve it.

Thanks in advance.

+1


source to share


3 answers


Does it work if you run the app from an elevated command prompt (WinKey and then press cmd and then Ctrl + Shift + Return)?



It is possible that one of the processes you are calling needs to be promoted.

+1


source


If for some reason you call stackoverflow it cannot be caught because there is no way to reliably unlock the column.



In this situation, your application will behave as you said.

+1


source


Well, after a lot of moves, it looks like this is "By Design" behavior!

StackOverflows own Jeff Atwood had a problem ( see here ) and raised the issue of Microsoft Connect ( see here ).

It looks like I'll be looking for an alternative approach, although the code does work on Server 2003.

Thank you for participating in your suggestions, which were very helpful.

0


source







All Articles