locked
Please, need urgent help. Application wont start (clr20r3 error) RRS feed

  • Question

  • Hi.

     

    Im a student and in last year. I was developing an application for the finish of shool and it worked ok - on some computers.

    I got an error on only some computers and the game (or app or quiz) wouldnt start!


    The school sent my app. to an competition and what i feared the most happened. The application wont start at their computers Sad I think i wont make this school ever if i dont get this application to start.

     

    Im giving you the Event viewer log and also  the whole source code of the application. Please, i just need to know how to fix this error and whats causing it. Please help me... or else im doomed Sad Please try the source code and take some minutes of your time for me :/

     

    The error log:

     

    Code Snippet

    Type: Error
    Event Source: .NET Runtime 2.0 Error Reporting
    Event Category: None
    Event ID: 5000
    Date:  13.5.2008
    Time:  9:59:51
    User:  N/A
    Computer: NB-LAPTOP
    Description:
    EventType clr20r3, P1 gktqt2mlox0vylsaef5mvfgwad2nxlfr, P2 1.0.0.0, P3 4807be7e, P4 y5fr4pseyqcbmjndxt5gaczr22qigqo2, P5 1.0.0.0, P6 4807be7e, P7 105, P8 e, P9 system.typeinitialization, P10 NIL.

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
    Data:
    0000: 63 00 6c 00 72 00 32 00   c.l.r.2.
    0008: 30 00 72 00 33 00 2c 00   0.r.3.,.
    0010: 20 00 67 00 6b 00 74 00    .g.k.t.
    0018: 71 00 74 00 32 00 6d 00   q.t.2.m.
    0020: 6c 00 6f 00 78 00 30 00   l.o.x.0.
    0028: 76 00 79 00 6c 00 73 00   v.y.l.s.
    0030: 61 00 65 00 66 00 35 00   a.e.f.5.
    0038: 6d 00 76 00 66 00 67 00   m.v.f.g.
    0040: 77 00 61 00 64 00 32 00   w.a.d.2.
    0048: 6e 00 78 00 6c 00 66 00   n.x.l.f.
    0050: 72 00 2c 00 20 00 31 00   r.,. .1.
    0058: 2e 00 30 00 2e 00 30 00   ..0...0.
    0060: 2e 00 30 00 2c 00 20 00   ..0.,. .
    0068: 34 00 38 00 30 00 37 00   4.8.0.7.
    0070: 62 00 65 00 37 00 65 00   b.e.7.e.
    0078: 2c 00 20 00 79 00 35 00   ,. .y.5.
    0080: 66 00 72 00 34 00 70 00   f.r.4.p.
    0088: 73 00 65 00 79 00 71 00   s.e.y.q.
    0090: 63 00 62 00 6d 00 6a 00   c.b.m.j.
    0098: 6e 00 64 00 78 00 74 00   n.d.x.t.
    00a0: 35 00 67 00 61 00 63 00   5.g.a.c.
    00a8: 7a 00 72 00 32 00 32 00   z.r.2.2.
    00b0: 71 00 69 00 67 00 71 00   q.i.g.q.
    00b8: 6f 00 32 00 2c 00 20 00   o.2.,. .
    00c0: 31 00 2e 00 30 00 2e 00   1...0...
    00c8: 30 00 2e 00 30 00 2c 00   0...0.,.
    00d0: 20 00 34 00 38 00 30 00    .4.8.0.
    00d8: 37 00 62 00 65 00 37 00   7.b.e.7.
    00e0: 65 00 2c 00 20 00 31 00   e.,. .1.
    00e8: 30 00 35 00 2c 00 20 00   0.5.,. .
    00f0: 65 00 2c 00 20 00 73 00   e.,. .s.
    00f8: 79 00 73 00 74 00 65 00   y.s.t.e.
    0100: 6d 00 2e 00 74 00 79 00   m...t.y.
    0108: 70 00 65 00 69 00 6e 00   p.e.i.n.
    0110: 69 00 74 00 69 00 61 00   i.t.i.a.
    0118: 6c 00 69 00 7a 00 61 00   l.i.z.a.
    0120: 74 00 69 00 6f 00 6e 00   t.i.o.n.
    0128: 20 00 4e 00 49 00 4c 00    .N.I.L.
    0130: 0d 00 0a 00               ....   

     

     

    Have a nice day,

    Matjaz

     

    ps: sorry for my bad english

    Source code link is here : http://www.sendspace.com/file/1cmdax
    Tuesday, May 13, 2008 10:27 AM

Answers

  • Can you post the class scope variables and constructor of the frmIme class? It may shed some light on what is causing the problem, if not look carefully at how each class scope variable is instantiated and how everything in the constructor is instantiated. Look for potential places where you might have a null reference or some other chance for throwing an exception when your type (frmIme) is being instantiated.

    One thing that might be causing this is trying to initialize a global variable with values that haven't been populated right, it will fail and cause the type initialization to fail and be reported like that.
    Wednesday, May 14, 2008 3:24 PM

All replies

  • Tuesday, May 13, 2008 12:35 PM
  • Tnx for the link... debugging would really help, but the problem is that the application works at my computer and doesnt at only some of them, thats why i cant debugg.

     

    isnt there any way that i (or you) can find out whats causing this error through that error log?
    Tuesday, May 13, 2008 1:02 PM
  • What's most interesting isn't the clr20r3 error code, it comes later in the line: system.typeinitialization
    you can see in the other thread someone else linked to, this was system.invalidoperationexception

    First question to ask with this, are you using any types from a library that isn't on the other machines or is using an older library without that type? So check to see which libraries (dll files) are utilized and make sure that there isn't a version mismatch possible and that other system do indeed have all the libraries you use. This would explain why it works on yours (and other computers) but fail on some.

    I would go over the types that you initialize in the constructor and as class scope directly, one of these initializations may be failing on the other computers.
    Tuesday, May 13, 2008 5:46 PM
  •  

    hi again.

    thanks for the answer. Umm... yeah, the application uses directx.audiovideoplayback

    thats the only added libary. but i dont understand if i add the software in the installer to install... why does it happen anyway?

    anyway i'll take a look at the code and try to debugg it at some other computer. just installing the VS. i hope the problem stays :/

     

    And the same question again... cant be nothing else be see through this error? nothing specific?

     

     

    bah...

     

    Thanks again. Please reply if you get any more ideas how could i fix this error.

     

    Bye,

    matjaz

    Tuesday, May 13, 2008 7:11 PM
  •  MatjazGrahek wrote:

    hi again.

    thanks for the answer. Umm... yeah, the application uses directx.audiovideoplayback

    thats the only added libary. but i dont understand if i add the software in the installer to install... why does it happen anyway?

    anyway i'll take a look at the code and try to debugg it at some other computer. just installing the VS. i hope the problem stays :/


    if you can, get a report of what version of DirectX they have. It's entirely possible they have DirectX but not the same exact version (especially with DirectX 9...). How are you adding the software into the installer, are you making it a prerequisit or just adding the installer and letting the user install (or not install) it? The other thing to check would be whether the systems it fails on are the same OS as what you are developing on or not.


     MatjazGrahek wrote:

    And the same question again... cant be nothing else be see through this error? nothing specific?



    There's some changes that can be made. You might be able to refactor suspect types from being created and instantiated automatically to being instantiated in a try/catch block to deal with the issue where the instantiation fails, which most likely means closing the program gently. With that you can also perform a check before instantiating those object to make sure you have the right or at least a compatible (newer?) version of the DirectX and alert the user if they don't have a compatible DirectX version. (IE: "You are using DirectX 9b, <name of program> requires DirectX 9c or newer" )

    Now I can't say for sure it's to do with DirectX but that seems the most likely suspect. Especially if you have anywhere where you instantiate a DirectX object when you define it as a class scope variable or inside the constructor of a class.
    Tuesday, May 13, 2008 7:52 PM
  •  

    Hi.

     

    Now im on the school computers with VS 2008 and newer framework. Well... this didnt work before and isnt working now either.

    Ok, here's what i got from debugging. Heres an error bug from that line where it stops (with calling the first form to open frmIme:

     

    Code Snippet
    System.TypeInitializationException was unhandled
      Message="The type initializer for 'Primoz_Trubar___Popotovanje.frmIme' threw an exception."
      Source="Popotovanje Primoža Trubarja"
      TypeName="Primoz_Trubar___Popotovanje.frmIme"
      StackTrace:
           at Primoz_Trubar___Popotovanje.frmIme..ctor()
           at Primoz_Trubar___Popotovanje.Program.Main()
           at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
           at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
           at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
           at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
           at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
           at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.runTryCode(Object userData)
           at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
           at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()
      InnerException: System.Security.SecurityException
           Message="That assembly does not allow partially trusted callers."
           Source="Popotovanje Primoža Trubarja"
           StackTrace:
                at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
                at Primoz_Trubar___Popotovanje.frmIme..cctor()
           InnerException:

     

     


    But i dont get it, since the only search results on google mattering my problem are - security (which i dont have a clue what that is) and something with global variables and maybe with calling the local .DLL (Microsoft.DirectX.AudioVideoPlayback) file.

     

    Please help? :/

    Wednesday, May 14, 2008 5:53 AM
  • Can you post the class scope variables and constructor of the frmIme class? It may shed some light on what is causing the problem, if not look carefully at how each class scope variable is instantiated and how everything in the constructor is instantiated. Look for potential places where you might have a null reference or some other chance for throwing an exception when your type (frmIme) is being instantiated.

    One thing that might be causing this is trying to initialize a global variable with values that haven't been populated right, it will fail and cause the type initialization to fail and be reported like that.
    Wednesday, May 14, 2008 3:24 PM