Plz Help Needed! The type initializer threw an exception. ---> System.UnauthorizedAccessException: A

Discussion in 'ASP .Net Security' started by batista, Mar 4, 2006.

  1. batista

    batista Guest

    Hello All,

    I have windows server 2003 with IIS 6.0..
    I have a webservice that is using a vc7 dll which in turn is using a
    com dll...now....

    there is a function there in that vc7 dll that is using the com dll to
    connect to a server running on different machine.

    Now when I call that function from webservice its giving me eception
    that

    System.TypeInitializationException: The type initializer for
    "TraderComponent.InteropWeb" threw an exception. --->
    System.UnauthorizedAccessException: Access is denied.

    TraderComponent is my vc7 dlls name...and interopweb is the class
    contaning that function..

    BTW this whole thing is working fine in windowx XP....

    I thnk it has something to do with the permission rights etc....

    Plz help me out on this...
    Wats causing the problem...

    Thanks
    Cheers...

    Bye.
     
    batista, Mar 4, 2006
    #1
    1. Advertising

  2. The fact that is a TypeInitializerException seems to indicate that you have
    a static constructor of some sort in this class that is trying to initialize
    your class, so the exception is being thrown there. However, the underlying
    issue is either a local ACL problem (on a file or reg key or something) or a
    delegation issue if you are trying to access a component on another network
    node via some sort of RPC mechanism.

    If this is an issue involving some local resources that are ACLed
    incorrectly, sometimes using filemon or regmon on the server and looking for
    "access denied" messages from the worker process will identify the problem
    and give you a quick fix.

    If the issue is related to the RPC, then we need more details. Can you talk
    a bit more about the RPC mechanism in question, how the current Windows
    security context in your web application was established (IWA, Basic, forms
    auth, impersonation settings, etc.) and how you were expecting the security
    context to flow to the remote machine.

    Joe K.

    "batista" <> wrote in message
    news:...
    > Hello All,
    >
    > I have windows server 2003 with IIS 6.0..
    > I have a webservice that is using a vc7 dll which in turn is using a
    > com dll...now....
    >
    > there is a function there in that vc7 dll that is using the com dll to
    > connect to a server running on different machine.
    >
    > Now when I call that function from webservice its giving me eception
    > that
    >
    > System.TypeInitializationException: The type initializer for
    > "TraderComponent.InteropWeb" threw an exception. --->
    > System.UnauthorizedAccessException: Access is denied.
    >
    > TraderComponent is my vc7 dlls name...and interopweb is the class
    > contaning that function..
    >
    > BTW this whole thing is working fine in windowx XP....
    >
    > I thnk it has something to do with the permission rights etc....
    >
    > Plz help me out on this...
    > Wats causing the problem...
    >
    > Thanks
    > Cheers...
    >
    > Bye.
    >
     
    Joe Kaplan \(MVP - ADSI\), Mar 4, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ibiza
    Replies:
    1
    Views:
    74,535
    Jon Skeet [C# MVP]
    Feb 25, 2006
  2. batista
    Replies:
    0
    Views:
    2,873
    batista
    Mar 4, 2006
  3. Replies:
    0
    Views:
    2,310
  4. Fredrik Kronander

    The type initializer threw an exception

    Fredrik Kronander, May 28, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    8,242
    Teemu Keiski
    May 29, 2008
  5. NoNickname

    The type initializer for 'MyClass' threw an exception

    NoNickname, Sep 16, 2006, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    986
    Michael D. Ober
    Sep 20, 2006
Loading...

Share This Page