how to run exe. file on a computer which dont have .Net

G

Guest

hi everyone!

i have created an application in C#. And i wanted to run its exe file on a
computer which dont have visual studio .Net installed on it. So i installed
the .Net framework on that computer and ran my exe. file but it gives the
following error :

"Application terminated , click ok to terminate the application and cancel
to start debuging"

what should i do so that an exe. file created in C3 can run on a computer
which only have .net framework installed on it not the whole visual studio
..Net
 
H

Hermit Dave

well for some reason your application is failing a run time error. Start up
your project on the machine with vs.net and put in some error handling code.
That way you know whats going wrong.
use try catch blocks and write to debugging text file to see whats happening
and where.

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
 
S

Sahil Malik

Well, in your C#, you probably have something like

[STAThread]
static void Main()
{
Application.Run(new Form1());
}

Put a try/catch block around that. (MSDN reference).

You should not have a problem running an application developed in
Vstudio.NET on a machine that has the .NET framework installed (Verify
versions though). The problem is probably in your logic. Also, you can check
out an article called "Taking exception to exceptions" by kimberly tripp, to
find as much data as possible about your exception, so you can then fix it
:) .. or simply do a exception.tostring() to get max info out of your
exception.

- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik
 
M

Morten Wennevik

A try/catch block may not catch all exceptions, in which case you can do

[STAThread]
static void Main()
{
try
{
Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
Application.Run(new Form1());
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}

private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
MessageBox.Show(e.Exception.Message);
}
 

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