Running C# program

L

lingfang zhen

I have C# program, what is the minimum setup required on
other PC (XP) to run C# (.NET) program. Do I need to put
Windows update for .Net on every system that I want to
run C# program? If not where can I find such package.

Thanks

lz
 
L

lingfang zhen

Ok, after installing .Net Framework redistribution 1.1,
my application still wouldn't run. A dialogbox - Common
Language Runtime Debugging Services is showing with:

Appliction has generated an exception that could not be
handled

Process id=0xb30(2864), Thread id=0xab0(2736)


The application is running fine on my development PC.
What could be wrong?
 
R

Richard Grimes [MVP]

What does the app do? Is it a console, service or a Forms app? Is there any
indication of the type of the .NET exception being thrown? Is there any
events in the event log?

In a console app I would put a try/catch around the code in the entry point
Main and print the exception details to the command line. For a service put
the try/catch in the main service rountine and log the exception details to
the event log. For a Forms app, add a thread exception handler and use that
to log the exception details to the event log.

Furthermore, I would put Debug.WriteLine messages in the app at appropriate
points and monitor the output debug stream.

Richard
 
F

Francois V. Laperriere

To handle your exception you effectively need a try/catch block. The type of
exception is shown
automatically when you debug the error. Just Cut and Paste the exception
name and catch it!

For the Console app I would recommend to use the Console.Error.WriteLine
property.
Returning to the command-line makes you return a String which
you have to ECHO out in a batch file.

Francois.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top