Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. TypeInitializationException

TypeInitializationException

Scheduled Pinned Locked Moved C#
help
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nasambur
    wrote on last edited by
    #1

    Hi, i hav two classes as following; class1.cs ---------- namespace NAS { // fields // properties public class Class1 { public Class1() {} } // member methods // ... } class2.cs ----------- namespace NAS { public class Class2 { private Class1 class1Obj; public void Meth() { class1Obj = new Class1(); // here i get an error } // it throws TypeInitializationException } } when i create an object of Class1 under Class2, i m getting TypeInitializationException. But i hav referred the class corretly in Reference.. Please help me.. :confused: NAS

    J 1 Reply Last reply
    0
    • N nasambur

      Hi, i hav two classes as following; class1.cs ---------- namespace NAS { // fields // properties public class Class1 { public Class1() {} } // member methods // ... } class2.cs ----------- namespace NAS { public class Class2 { private Class1 class1Obj; public void Meth() { class1Obj = new Class1(); // here i get an error } // it throws TypeInitializationException } } when i create an object of Class1 under Class2, i m getting TypeInitializationException. But i hav referred the class corretly in Reference.. Please help me.. :confused: NAS

      J Offline
      J Offline
      J4amieC
      wrote on last edited by
      #2

      If that code is exactly identical to what you are running there is no way that you would get that exception. Im guessing there is some form of reflection and/or remoting going on somewhere!

      --- How to get answers to your questions[^]

      N 1 Reply Last reply
      0
      • J J4amieC

        If that code is exactly identical to what you are running there is no way that you would get that exception. Im guessing there is some form of reflection and/or remoting going on somewhere!

        --- How to get answers to your questions[^]

        N Offline
        N Offline
        nasambur
        wrote on last edited by
        #3

        Hi J4amieC, You are right..!! i got it.. Actually i m using Threading inside one delegate methods which causes an error. Thanks.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups