WindowsForm Exception

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Amjad

    #1

    WindowsForm Exception

    I wrote a WindowsForms application and I compiled, installed, and run it on
    my computer without any problems. When I install it on another computer that
    doesn't have VS.NET installed I get the following error message immediately
    after I double-click on its icon:

    "MyApp.exe - Common Language Runtime Debugging Services
    Application has generated an exception that could not be handled.
    Proess id=0x884(2180), Thread id=0xb14(2386).
    Click Ok to terminate the application.
    Click CANCEL to debug the application.
    "

    The dot Net Framework is installed on all my computers and I have other
    applications that I wrote before working fine on this computer. The problem
    is I don't know where to look for the cause of this problem and since I don't
    have a "Registered JIT debugger" on the machine in question I can't
    troubleshoot it there.

    I tried to add in the "Form_Load" event something like: 'Msgbox ("Test")' to
    see if my application reaches the Form_Load stage before it generates the
    error. And it never showed that message box. So I'm assuming the exception
    occurs even before that!

    Does any one know how we can troubleshoot/debug in this situation?
  • Chris

    #2
    Re: WindowsForm Exception

    Amjad wrote:[color=blue]
    > I wrote a WindowsForms application and I compiled, installed, and run it on
    > my computer without any problems. When I install it on another computer that
    > doesn't have VS.NET installed I get the following error message immediately
    > after I double-click on its icon:
    >
    > "MyApp.exe - Common Language Runtime Debugging Services
    > Application has generated an exception that could not be handled.
    > Proess id=0x884(2180), Thread id=0xb14(2386).
    > Click Ok to terminate the application.
    > Click CANCEL to debug the application.
    > "
    >
    > The dot Net Framework is installed on all my computers and I have other
    > applications that I wrote before working fine on this computer. The problem
    > is I don't know where to look for the cause of this problem and since I don't
    > have a "Registered JIT debugger" on the machine in question I can't
    > troubleshoot it there.
    >
    > I tried to add in the "Form_Load" event something like: 'Msgbox ("Test")' to
    > see if my application reaches the Form_Load stage before it generates the
    > error. And it never showed that message box. So I'm assuming the exception
    > occurs even before that!
    >
    > Does any one know how we can troubleshoot/debug in this situation?[/color]

    Just a shot in the dark but you could be getting a security exception.
    Try to full trust the assembly and see if that helps.

    Chris

    Comment

    • Amjad

      #3
      Re: WindowsForm Exception

      It's already set to Full Trust, and I'm still getting the same
      non-informative error message.

      Any other ideas?


      "Chris" wrote:
      [color=blue]
      > Amjad wrote:[color=green]
      > > I wrote a WindowsForms application and I compiled, installed, and run it on
      > > my computer without any problems. When I install it on another computer that
      > > doesn't have VS.NET installed I get the following error message immediately
      > > after I double-click on its icon:
      > >
      > > "MyApp.exe - Common Language Runtime Debugging Services
      > > Application has generated an exception that could not be handled.
      > > Proess id=0x884(2180), Thread id=0xb14(2386).
      > > Click Ok to terminate the application.
      > > Click CANCEL to debug the application.
      > > "
      > >
      > > The dot Net Framework is installed on all my computers and I have other
      > > applications that I wrote before working fine on this computer. The problem
      > > is I don't know where to look for the cause of this problem and since I don't
      > > have a "Registered JIT debugger" on the machine in question I can't
      > > troubleshoot it there.
      > >
      > > I tried to add in the "Form_Load" event something like: 'Msgbox ("Test")' to
      > > see if my application reaches the Form_Load stage before it generates the
      > > error. And it never showed that message box. So I'm assuming the exception
      > > occurs even before that!
      > >
      > > Does any one know how we can troubleshoot/debug in this situation?[/color]
      >
      > Just a shot in the dark but you could be getting a security exception.
      > Try to full trust the assembly and see if that helps.
      >
      > Chris
      >[/color]

      Comment

      • Chris

        #4
        Re: WindowsForm Exception

        Amjad wrote:[color=blue]
        > It's already set to Full Trust, and I'm still getting the same
        > non-informative error message.
        >
        > Any other ideas?
        >
        >
        > "Chris" wrote:
        >
        >[color=green]
        >>Amjad wrote:
        >>[color=darkred]
        >>>I wrote a WindowsForms application and I compiled, installed, and run it on
        >>>my computer without any problems. When I install it on another computer that
        >>>doesn't have VS.NET installed I get the following error message immediately
        >>>after I double-click on its icon:
        >>>
        >>>"MyApp.exe - Common Language Runtime Debugging Services
        >>>Applicatio n has generated an exception that could not be handled.
        >>>Proess id=0x884(2180), Thread id=0xb14(2386).
        >>>Click Ok to terminate the application.
        >>>Click CANCEL to debug the application.
        >>>"
        >>>
        >>>The dot Net Framework is installed on all my computers and I have other
        >>>applicatio ns that I wrote before working fine on this computer. The problem
        >>>is I don't know where to look for the cause of this problem and since I don't
        >>>have a "Registered JIT debugger" on the machine in question I can't
        >>>troublesho ot it there.
        >>>
        >>>I tried to add in the "Form_Load" event something like: 'Msgbox ("Test")' to
        >>>see if my application reaches the Form_Load stage before it generates the
        >>>error. And it never showed that message box. So I'm assuming the exception
        >>>occurs even before that!
        >>>
        >>>Does any one know how we can troubleshoot/debug in this situation?[/color]
        >>
        >>Just a shot in the dark but you could be getting a security exception.
        >>Try to full trust the assembly and see if that helps.
        >>
        >>Chris
        >>[/color][/color]

        Try to wrap the entire program in a try... catch block. Start the
        program in a module and do:

        sub main
        try
        dim F as new Form1
        Application.Run (F)
        catch ex as exception
        messagebox.show (ex.description )
        end try
        end sub

        This may help you get a better idea what the error is.

        Chris

        Comment

        • Amjad

          #5
          Re: WindowsForm Exception

          Thanks Chris. That was a good idea.

          The problem was one of the DLLs I used had the "Exclude" property set to
          False for some reason!

          Everything seems to be fine again now :)


          "Chris" wrote:
          [color=blue]
          > Amjad wrote:[color=green]
          > > It's already set to Full Trust, and I'm still getting the same
          > > non-informative error message.
          > >
          > > Any other ideas?
          > >
          > >
          > > "Chris" wrote:
          > >
          > >[color=darkred]
          > >>Amjad wrote:
          > >>
          > >>>I wrote a WindowsForms application and I compiled, installed, and run it on
          > >>>my computer without any problems. When I install it on another computer that
          > >>>doesn't have VS.NET installed I get the following error message immediately
          > >>>after I double-click on its icon:
          > >>>
          > >>>"MyApp.exe - Common Language Runtime Debugging Services
          > >>>Applicatio n has generated an exception that could not be handled.
          > >>>Proess id=0x884(2180), Thread id=0xb14(2386).
          > >>>Click Ok to terminate the application.
          > >>>Click CANCEL to debug the application.
          > >>>"
          > >>>
          > >>>The dot Net Framework is installed on all my computers and I have other
          > >>>applicatio ns that I wrote before working fine on this computer. The problem
          > >>>is I don't know where to look for the cause of this problem and since I don't
          > >>>have a "Registered JIT debugger" on the machine in question I can't
          > >>>troublesho ot it there.
          > >>>
          > >>>I tried to add in the "Form_Load" event something like: 'Msgbox ("Test")' to
          > >>>see if my application reaches the Form_Load stage before it generates the
          > >>>error. And it never showed that message box. So I'm assuming the exception
          > >>>occurs even before that!
          > >>>
          > >>>Does any one know how we can troubleshoot/debug in this situation?
          > >>
          > >>Just a shot in the dark but you could be getting a security exception.
          > >>Try to full trust the assembly and see if that helps.
          > >>
          > >>Chris
          > >>[/color][/color]
          >
          > Try to wrap the entire program in a try... catch block. Start the
          > program in a module and do:
          >
          > sub main
          > try
          > dim F as new Form1
          > Application.Run (F)
          > catch ex as exception
          > messagebox.show (ex.description )
          > end try
          > end sub
          >
          > This may help you get a better idea what the error is.
          >
          > Chris
          >[/color]

          Comment

          Working...