Tech Off Thread

15 posts

.NET 2.0 Win App Eror (EventType clr20r3)

Back to Forum: Tech Off
  • User profile image
    amit_trehan

    Hi, I have a .NET 2.0 win app (VB.NET), that is working perfectly fine on the machine where it is developed. But when deployed on any other machne crashes on startup without any eror massage. If checked in the application log the following is the erro

    "EventType clr20r3, P1 dnvpilot.exe, P2 1.0.0.0, P3 472b251b, P4 dnvpilot, P5 1.0.0.0, P6 472b251b, P7 14, P8 e9, P9 system.invalidoperationexception, P10 NIL."

    Please suggest , its very urgent.

    Thanks

  • User profile image
    JDUBYA

    Is this a ClickOnce deployment?

    Are you using threading?

    More details..

  • User profile image
    AhmedKelani2

    hi Smiley

    am Ahmed "not the first person who asked u and stopped responding Tongue Out "

     

    i have the same problem ...

    i have a windows application developed using C# vs 2005

    we also used WCF technology!

    and yes ... we are using threading , and ClickOnce deployment
    but we changed the ClickOnce deployment to ordenary one!
    and we still facing this problem :

    Event type clr20r3,P1 civilRegistrationApplication.exe, P2 0.1.0.0, P3 475195ff, P4 system. Servicemodel, P5 3.0.0.0, P6 4545a17d, P7 ef, P8 0, P9 system.typeinitialization, P10 NIL

    plz help!!

  • User profile image
    vbrunner__

    my first suggestion is to make sure that .NET 2.0 is properly installed on the client machine.  many times stock XP machines are missing various dlls in the GAC if they have not touched the internet in a while.  Just run the setup.exe that is deployed with your ClickOnce deployment, then try it again.

    if that doesn't work, try one of the two following things:
    1. Create a Setup project that only installs all the detected dependencies of the project you are trying to deploy, but not the project output.  this will ensure that the GAC has all the neccessary assemblies for your application.
    2. Manually check the dependencies in both the GAC and the locations your application is loading them from.

    for all i know this could have nothing to do with missing assemblies, but that seems to be the  remedy when it happens to me.

  • User profile image
    AhmedKelani2

    my OS is Win 2003

    am sure that both framework 2 and 3 are installed on the client machine!

     

    and i did wt u told me and checked the dependancies but it still the same Sad

  • User profile image
    vbrunner__

    in that case my only suggestion is wrapping everything in Main(string[] args) with a try and see if anything is caught.  but if you're seeing the error i think you are it's occurring before Main is even called, so i'm sorry but beyond that i don't know.  where's littleguru when you need him?

  • User profile image
    AhmedKelani2

    but is there anybody knows wt

      JDUBYA  ment when he asked if we used threading and click once deployment?? Sad

  • User profile image
    f1rst_kn1ght

    Good day.

    I have experienced the same problem.

    In my case, I have developed a VB.net 2005 application to execute macros and process reports. I used threading so that even if the application would encounter any problem while executing the macros, it would still process other report-related files.

    The said application is being called by a windows service for execution. This is so because I was having problems when I developed its equivalent in windows service.

    Later on, the application was deployed on a production server, and it worked well. But just yesterday, I was informed that there's a problem, they sent me the screenshot of the error from the event log viewer.

    Please help me. Thanks a lot.


    Smiley

  • User profile image
    JChung2006

    Implement an UnhandledExceptionHandler and log the exception information to the Event Log so that you can get better information about what is causing your application to crash and in what context.

    // C# 2.0
    static void Main(string[] args)
    {
      AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(
        delegate(object sender, UnhandledExceptionEventArgs e) {
          if (e.IsTerminating) {
            object o = e.ExceptionObject;
            Debug.WriteLine(o.ToString()); // use EventLog instead
          }
        }
      );
    
      // rest of your Main code
    }
    
    // C# 3.0
    static void Main(string[] args)
    {
      AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(
        (sender, e) => {
          if (e.IsTerminating) {
            object o = e.ExceptionObject;
            Debug.WriteLine(o.ToString()); // use EventLog instead
          }
        }
      );
    
      // rest of your Main code
    }
    
    ' Visual Basic -- anonymous methods WRU?
    Sub UnhandledExceptionEventRaised(ByVal sender As Object, ByVal e As UnhandledExceptionEventArgs)
      If e.IsTerminating Then
        Dim o As Object = e.ExceptionObject
        Debug.WriteLine(o.ToString) ' use EventLog instead
      End If
    End Sub
    
    Sub Main()
      AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf UnhandledExceptionEventRaised
    
      ' rest of your Main code
    End Sub
    
  • User profile image
    f1rst_kn1ght

    Hi.

    Please refer to this URL - http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2713521&SiteID=1&mode=1 

    I have encountered the same error, and I was able to solve it just about 30 minutes ago.

    Thanks.

  • User profile image
    AhmedKelani2

    Smiley

  • User profile image
    Angrist

    AhmedKelani2 said:

    Smiley

    Cheers guys, fixed my occurance of this error :o)

    Turns out on certain system setups, most of the time "winxp pro sp2 .NET framework 2.0" and  "win2003 .NET framework 2.0 (not sure which service pack if any)" that don't have Visual Studio 2005 or above installed) are missed certain dlls that create this error for a variety of different reasons.. I've seen forum posts saying it's due to unregistered dll's, certain form controls that have member variables that needed commenting out and also corrupted .NET framework installs.

    For me it turns out to be a font that was missed out of my setup project, on the above winxp setup (actually running on a virtual machine), it threw an exception during the component initialisation which I identified with JChung2006's debug code posted above :o)

    Happy hunting for anyone else trying to work this one out.

  • User profile image
    ZachBaker

    JChung2006 said:

    Implement an UnhandledExceptionHandler and log the exception information to the Event Log so that you can get better information about what is causing your application to crash and in what context.

    // C# 2.0
    static void Main(string[] args)
    {
      AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(
        delegate(object sender, UnhandledExceptionEventArgs e) {
          if (e.IsTerminating) {
            object o = e.ExceptionObject;
            Debug.WriteLine(o.ToString()); // use EventLog instead
          }
        }
      );
    
      // rest of your Main code
    }
    
    // C# 3.0
    static void Main(string[] args)
    {
      AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(
        (sender, e) => {
          if (e.IsTerminating) {
            object o = e.ExceptionObject;
            Debug.WriteLine(o.ToString()); // use EventLog instead
          }
        }
      );
    
      // rest of your Main code
    }
    
    ' Visual Basic -- anonymous methods WRU?
    Sub UnhandledExceptionEventRaised(ByVal sender As Object, ByVal e As UnhandledExceptionEventArgs)
      If e.IsTerminating Then
        Dim o As Object = e.ExceptionObject
        Debug.WriteLine(o.ToString) ' use EventLog instead
      End If
    End Sub
    
    Sub Main()
      AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf UnhandledExceptionEventRaised
    
      ' rest of your Main code
    End Sub
    
    Thanks for that tip JChung2006 of using the unhandled exception handler!  It helped me find my true problem, which had absolutely nothing to do with threading, but rather that I was sending a string that was TOO LARGE to the event log!

  • User profile image
    scorpian king

    ZachBaker said:
    JChung2006 said:
    *snip*
    Thanks for that tip JChung2006 of using the unhandled exception handler!  It helped me find my true problem, which had absolutely nothing to do with threading, but rather that I was sending a string that was TOO LARGE to the event log!

    I am new to vb.net . when i created the windows setup project and installed windows vb.net applcation at client machine. Applicaiton works fine if user is administrator at client side. if user is standerd user this applciation will not work and will give error "Eventtype: Clr20r3  P1:applicaiton.exe P2 1.0.0.0 P3:4c34c703 P4 applicaiton version P5:1.0.0.0.0 P6:4c34c703  P7:a9  P8: e9  P9: system.invalidoperationexception" . I install the same application on development workstation it works even fine in standerd user mode too. This application also works fine in all the computer if you run it under admin mode. I want the application to run in all the client machines in standerd user mode and not in the admin mode.

     

    I already inserted UnhandledExceptionEventRaised() code but it is not being called. The application get terminated at client side before it gets initialized in standerard user mode.

     

    Can anyone suggest what might be the problem?

  • User profile image
    spivonious

    scorpian king said:
    ZachBaker said:
    *snip*

    I am new to vb.net . when i created the windows setup project and installed windows vb.net applcation at client machine. Applicaiton works fine if user is administrator at client side. if user is standerd user this applciation will not work and will give error "Eventtype: Clr20r3  P1:applicaiton.exe P2 1.0.0.0 P3:4c34c703 P4 applicaiton version P5:1.0.0.0.0 P6:4c34c703  P7:a9  P8: e9  P9: system.invalidoperationexception" . I install the same application on development workstation it works even fine in standerd user mode too. This application also works fine in all the computer if you run it under admin mode. I want the application to run in all the client machines in standerd user mode and not in the admin mode.

     

    I already inserted UnhandledExceptionEventRaised() code but it is not being called. The application get terminated at client side before it gets initialized in standerard user mode.

     

    Can anyone suggest what might be the problem?

    Why did you raise this 1.5 year-old thread when your problem is completely different?

     

    Anyway, it's hard to say what's happening without more details, but I'd guess it's a permissions error.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.