The type initializer threw an exception

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?RnJlZHJpayBLcm9uYW5kZXI=?=

    #1

    The type initializer threw an exception

    Hi,

    I have an ASP.NET application that uses a static class for caching xml
    document and compiled xsl transforms. This has been working fine up until now
    when I'm trying to install it to an additional webserver (we had 4
    previously), which gives me the error "The type initializer for
    "ChrossNet.Cach e" threw an exception" where ChrossNet.Cache is my static
    class. The code is exactly the same of course.

    As far as I can see there are no differences between the servers, but as I'm
    having a problem something must differ - I just don't really know where to
    look.

    Has anyone else seen this problem?

  • Teemu Keiski

    #2
    Re: The type initializer threw an exception

    Does it do something special in the static constructor?

    --
    Teemu Keiski
    AspInsider, ASP.NET MVP



    "Fredrik Kronander" <FredrikKronand er@discussions. microsoft.comwr ote in
    message news:30716CD9-9E52-43F9-AA65-FB8347121466@mi crosoft.com...
    Hi,
    >
    I have an ASP.NET application that uses a static class for caching xml
    document and compiled xsl transforms. This has been working fine up until
    now
    when I'm trying to install it to an additional webserver (we had 4
    previously), which gives me the error "The type initializer for
    "ChrossNet.Cach e" threw an exception" where ChrossNet.Cache is my static
    class. The code is exactly the same of course.
    >
    As far as I can see there are no differences between the servers, but as
    I'm
    having a problem something must differ - I just don't really know where to
    look.
    >
    Has anyone else seen this problem?
    >

    Comment

    • =?Utf-8?B?RnJlZHJpayBLcm9uYW5kZXI=?=

      #3
      Re: The type initializer threw an exception

      Thanks for your reply.

      No, it doesn't do anything at all in the constructor. The class has some
      static member variables that will be initialized on the first hit, but that
      is done in the get methods, not in the constructor.



      "Teemu Keiski" wrote:
      Does it do something special in the static constructor?
      >
      --
      Teemu Keiski
      AspInsider, ASP.NET MVP


      >
      "Fredrik Kronander" <FredrikKronand er@discussions. microsoft.comwr ote in
      message news:30716CD9-9E52-43F9-AA65-FB8347121466@mi crosoft.com...
      Hi,

      I have an ASP.NET application that uses a static class for caching xml
      document and compiled xsl transforms. This has been working fine up until
      now
      when I'm trying to install it to an additional webserver (we had 4
      previously), which gives me the error "The type initializer for
      "ChrossNet.Cach e" threw an exception" where ChrossNet.Cache is my static
      class. The code is exactly the same of course.

      As far as I can see there are no differences between the servers, but as
      I'm
      having a problem something must differ - I just don't really know where to
      look.

      Has anyone else seen this problem?
      >
      >
      >

      Comment

      • Teemu Keiski

        #4
        Re: The type initializer threw an exception

        Ok, that sounds weird then. Are you sure it cannot be initialization of some
        of these members?

        Teemu

        "Fredrik Kronander" <FredrikKronand er@discussions. microsoft.comwr ote in
        message news:9E5C4D7A-7CED-45DC-AA06-5D8238F59729@mi crosoft.com...
        Thanks for your reply.
        >
        No, it doesn't do anything at all in the constructor. The class has some
        static member variables that will be initialized on the first hit, but
        that
        is done in the get methods, not in the constructor.
        >
        >
        >
        "Teemu Keiski" wrote:
        >
        >Does it do something special in the static constructor?
        >>
        >--
        >Teemu Keiski
        >AspInsider, ASP.NET MVP
        >http://blogs.aspadvice.com/joteke
        >http://teemukeiski.net
        >>
        >"Fredrik Kronander" <FredrikKronand er@discussions. microsoft.comwr ote in
        >message news:30716CD9-9E52-43F9-AA65-FB8347121466@mi crosoft.com...
        Hi,
        >
        I have an ASP.NET application that uses a static class for caching xml
        document and compiled xsl transforms. This has been working fine up
        until
        now
        when I'm trying to install it to an additional webserver (we had 4
        previously), which gives me the error "The type initializer for
        "ChrossNet.Cach e" threw an exception" where ChrossNet.Cache is my
        static
        class. The code is exactly the same of course.
        >
        As far as I can see there are no differences between the servers, but
        as
        I'm
        having a problem something must differ - I just don't really know where
        to
        look.
        >
        Has anyone else seen this problem?
        >
        >>
        >>
        >>

        Comment

        Working...