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

Discussion in 'Microsoft Dot NET Framework' started by Guest, Sep 24, 2004.

  1. Guest

    Guest 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
     
    Guest, Sep 24, 2004
    #1
    1. Advertisements

  2. Guest

    Hermit Dave Guest

    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" <> wrote in message
    news:...
    > 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
    >
    >
     
    Hermit Dave, Sep 24, 2004
    #2
    1. Advertisements

  3. Guest

    Guest Guest

    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" <> wrote in message
    > news:...
    > > 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
    > >
    > >

    >
    >
    >
     
    Guest, Sep 24, 2004
    #3
  4. Guest

    Sahil Malik Guest

    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" <> wrote in message
    news:...
    > 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
    >
    >
     
    Sahil Malik, Sep 24, 2004
    #4
  5. Guest

    Hermit Dave Guest

    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" <> wrote in message
    news:...
    > 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" <> wrote in message
    > > news:...
    > > > 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
    > > >
    > > >

    > >
    > >
    > >
     
    Hermit Dave, Sep 24, 2004
    #5
  6. 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]
     
    Morten Wennevik, Sep 25, 2004
    #6
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Frank Meng

    Which process/which user changed the file?

    Frank Meng, Jan 12, 2004, in forum: Microsoft Dot NET Framework
    Replies:
    2
    Views:
    259
    Frank Meng
    Jan 13, 2004
  2. Guest

    Find which machines do NOT have .NET Framework installed

    Guest, Jun 10, 2005, in forum: Microsoft Dot NET Framework
    Replies:
    2
    Views:
    204
    Guest
    Jun 10, 2005
  3. Daniel
    Replies:
    2
    Views:
    258
    Otis Mukinfus
    Aug 8, 2005
  4. Guest

    I have 2 versions of .NET, which is being used

    Guest, Dec 31, 2005, in forum: Microsoft Dot NET Framework
    Replies:
    67
    Views:
    893
    Willy Denoyette [MVP]
    Jan 10, 2006
  5. albusmw
    Replies:
    7
    Views:
    187
    Martin Weiss
    Oct 24, 2007
Loading...

Share This Page