PC Review


Reply
Thread Tools Rate Thread

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

 
 
=?Utf-8?B?TXVheiBGYXJvb3E=?=
Guest
Posts: n/a
 
      24th Sep 2004
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


 
Reply With Quote
 
 
 
 
Hermit Dave
Guest
Posts: n/a
 
      24th Sep 2004
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)
"Muaz Farooq" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?TXVheiBGYXJvb3E=?=
Guest
Posts: n/a
 
      24th Sep 2004
plz specify where to put the try catch block in the code as i am not an
expert of C#

"Hermit Dave" wrote:

> 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)
> "Muaz Farooq" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >
> >

>
>
>

 
Reply With Quote
 
Sahil Malik
Guest
Posts: n/a
 
      24th Sep 2004
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



"Muaz Farooq" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Hermit Dave
Guest
Posts: n/a
 
      24th Sep 2004
say you have a method

private void DoSomething()
{
// do something code with try catch
try
{
// do something
}
catch(Exception ex)
{
// handle your exception before its too late
}
}

for more info look up
www.msdn.microsoft.com

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Muaz Farooq" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> plz specify where to put the try catch block in the code as i am not an
> expert of C#
>
> "Hermit Dave" wrote:
>
> > 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)
> > "Muaz Farooq" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > 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
> > >
> > >

> >
> >
> >



 
Reply With Quote
 
Morten Wennevik
Guest
Posts: n/a
 
      25th Sep 2004
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);
}


--
Happy coding!
Morten Wennevik [C# MVP]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you run a Access database on a computer if you DONT have Acces Ted Microsoft Excel Misc 2 9th Feb 2009 10:46 PM
Is there a way to synchronize favorites between 2 computers? i.e. copy any favorites on computer A but not computer B to computer B and any on computer B but not computer A to computer A? Huck Microsoft Outlook Contacts 1 17th Sep 2006 10:54 AM
Run my query it prompt which i dont want Eric Microsoft Access 2 5th Sep 2006 02:32 AM
virus..dont have hp restore cd....HELP!!!! i dont wanna lose our p =?Utf-8?B?a2ltICYgYnJpYW4gZG9ic29u?= Windows XP Performance 2 8th Mar 2005 05:27 AM
I have added a hyperlink on my database, which i dont want it on . =?Utf-8?B?Y2hlZ2dlcno=?= Microsoft Access 1 4th Feb 2005 09:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:17 AM.