Receiving a strong name error when trying to access a library

Discussion in 'ASP .Net Security' started by pottschmidtr@yahoo.com, Jun 20, 2005.

  1. Guest

    I receive the following error 'Request for the permission of type
    System.Security.Permissions.St­rongNameIdentityPermission, mscorlib,
    Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e08­9
    failed.' when I try to access a property or method of the library. I
    was wondering if the library is secure with a key, so the caller has to

    be sign with same key or I'm calling the library incorrectly. Do I need

    an assembly tag with in code?


    I'm attempting to add functionality to a product by adding inline C#
    code to a ASP.Net control. The software does not have a published SDK
    but I can determine how to use the libaries from previous versions. Any

    help is greatly appreciated and links to documentation or explanation
    are great helps for learning.


    Many thanks,

    Robert Pottschmidt


    Below is the code sample:
    ....
    Software.DataLayer.One a;
    Software.BusinessLogic.Two b;
    a =(Software.Libary.One) Session["XXXXX"];
    a = l.Inbox; //The code blows up here with the above error
    ....


    PermView of the classes:


    C:\Documents and Settings\rob>permview /decl Software.Libary.dll


    Microsoft (R) .NET Framework Permission Request Viewer. Version
    1.1.4322.573
    Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.


    Class Software.DataLayer.One LinktimeDemand permission set:
    <PermissionSet class="System.Security.Permiss­ionSet"
    version="1">
    <IPermission
    class="System.Security.Permiss­ions.StrongNameIdentityPermiss­ion,
    mscorlib, Version=1.0.5000.0, Culture=neutral,
    PublicKeyToken=b77a5c561934e08­9"
    version="1"


    PublicKeyBlob="002400000480000­094000000060200000024000052534­1310
    0040000010001007F850AB9C51768C­40BB2BC90AC0E7A733B0717D1139F2­BDE487A76A8FA93E887D

    2CB0B63EF25B401038A7A48CA5DB63­8EFD867515D8219EF8A58F3B1D098C­89C278F6078789564F1F

    6F6C088729F4D0D3BEE66E923A49B9­A22E3404837A14E5DDB1AC258BB0C1­22329B06E531E05CF2E7

    214936E57EE0F998BC093AD2C351BB­9"/>
    </PermissionSet>





    Below is the code sample:
    ....
    Software.DataLayer.One a;
    Software.BusinessLogic.Two b;
    a =(Software.DataLayer.One) Session["XXXXX"];
    b = a.Inbox; //The code blows up here with the above error
    ....


    PermView of the classes:


    C:\Documents and Settings\rob>permview /decl Software.Libary.dll


    Microsoft (R) .NET Framework Permission Request Viewer. Version
    1.1.4322.573
    Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.


    Class Software.DataLayer.One LinktimeDemand permission set:
    <PermissionSet class="System.Security.Permiss­ionSet"
    version="1">
    <IPermission
    class="System.Security.Permiss­ions.StrongNameIdentityPermiss­ion,
    mscorlib, Version=1.0.5000.0, Culture=neutral,
    PublicKeyToken=b77a5c561934e08­9"
    version="1"


    PublicKeyBlob="002400000480000­094000000060200000024000052534­1310
    0040000010001007F850AB9C51768C­40BB2BC90AC0E7A733B0717D1139F2­BDE487A76A8FA93E887D

    2CB0B63EF25B401038A7A48CA5DB63­8EFD867515D8219EF8A58F3B1D098C­89C278F6078789564F1F

    6F6C088729F4D0D3BEE66E923A49B9­A22E3404837A14E5DDB1AC258BB0C1­22329B06E531E05CF2E7

    214936E57EE0F998BC093AD2C351BB­9"/>
    </PermissionSet>
     
    , Jun 20, 2005
    #1
    1. Advertising

  2. Joe_Langley Guest

    This usually means that the user that is attempting to access this does not
    have the correct permissions...assuming this is a webapp (i believe you said
    you are using asp.net) the request will have the security context of the
    webapp...

    I had a similiar problem trying to access Active Directory...the local
    ASPNET account does not have enough permissions, so I needed to modify that
    in the machine.config file.

    Cheers!

    "" wrote:

    > I receive the following error 'Request for the permission of type
    > System.Security.Permissions.St­rongNameIdentityPermission, mscorlib,
    > Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e08­9
    > failed.' when I try to access a property or method of the library. I
    > was wondering if the library is secure with a key, so the caller has to
    >
    > be sign with same key or I'm calling the library incorrectly. Do I need
    >
    > an assembly tag with in code?
    >
    >
    > I'm attempting to add functionality to a product by adding inline C#
    > code to a ASP.Net control. The software does not have a published SDK
    > but I can determine how to use the libaries from previous versions. Any
    >
    > help is greatly appreciated and links to documentation or explanation
    > are great helps for learning.
    >
    >
    > Many thanks,
    >
    > Robert Pottschmidt
    >
    >
    > Below is the code sample:
    > ....
    > Software.DataLayer.One a;
    > Software.BusinessLogic.Two b;
    > a =(Software.Libary.One) Session["XXXXX"];
    > a = l.Inbox; //The code blows up here with the above error
    > ....
    >
    >
    > PermView of the classes:
    >
    >
    > C:\Documents and Settings\rob>permview /decl Software.Libary.dll
    >
    >
    > Microsoft (R) .NET Framework Permission Request Viewer. Version
    > 1.1.4322.573
    > Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
    >
    >
    > Class Software.DataLayer.One LinktimeDemand permission set:
    > <PermissionSet class="System.Security.Permiss­ionSet"
    > version="1">
    > <IPermission
    > class="System.Security.Permiss­ions.StrongNameIdentityPermiss­ion,
    > mscorlib, Version=1.0.5000.0, Culture=neutral,
    > PublicKeyToken=b77a5c561934e08­9"
    > version="1"
    >
    >
    > PublicKeyBlob="002400000480000­094000000060200000024000052534­1310
    > 0040000010001007F850AB9C51768C­40BB2BC90AC0E7A733B0717D1139F2­BDE487A76A8FA93E887D
    >
    > 2CB0B63EF25B401038A7A48CA5DB63­8EFD867515D8219EF8A58F3B1D098C­89C278F6078789564F1F
    >
    > 6F6C088729F4D0D3BEE66E923A49B9­A22E3404837A14E5DDB1AC258BB0C1­22329B06E531E05CF2E7
    >
    > 214936E57EE0F998BC093AD2C351BB­9"/>
    > </PermissionSet>
    >
    >
    >
    >
    >
    > Below is the code sample:
    > ....
    > Software.DataLayer.One a;
    > Software.BusinessLogic.Two b;
    > a =(Software.DataLayer.One) Session["XXXXX"];
    > b = a.Inbox; //The code blows up here with the above error
    > ....
    >
    >
    > PermView of the classes:
    >
    >
    > C:\Documents and Settings\rob>permview /decl Software.Libary.dll
    >
    >
    > Microsoft (R) .NET Framework Permission Request Viewer. Version
    > 1.1.4322.573
    > Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
    >
    >
    > Class Software.DataLayer.One LinktimeDemand permission set:
    > <PermissionSet class="System.Security.Permiss­ionSet"
    > version="1">
    > <IPermission
    > class="System.Security.Permiss­ions.StrongNameIdentityPermiss­ion,
    > mscorlib, Version=1.0.5000.0, Culture=neutral,
    > PublicKeyToken=b77a5c561934e08­9"
    > version="1"
    >
    >
    > PublicKeyBlob="002400000480000­094000000060200000024000052534­1310
    > 0040000010001007F850AB9C51768C­40BB2BC90AC0E7A733B0717D1139F2­BDE487A76A8FA93E887D
    >
    > 2CB0B63EF25B401038A7A48CA5DB63­8EFD867515D8219EF8A58F3B1D098C­89C278F6078789564F1F
    >
    > 6F6C088729F4D0D3BEE66E923A49B9­A22E3404837A14E5DDB1AC258BB0C1­22329B06E531E05CF2E7
    >
    > 214936E57EE0F998BC093AD2C351BB­9"/>
    > </PermissionSet>
    >
    >
     
    Joe_Langley, Jun 20, 2005
    #2
    1. Advertising

  3. In some cases this might be the issue, but not with a
    StrongNameIdentityPermission.

    The issue is that the owner of the code has set the member that is being
    accessed to only be called by other assemblies that were signed with a
    specific strong name key.

    The way to get around this is basically with hacking as they designed the
    code with the intent that you not do this. You can disable CAS policy on
    each machine that needs to run this, reverse engineer the vendors code
    (probably illegal) or use one of the other strong name hacking techniques
    that have been discussed publicly.

    The right thing to do is to not do this though.

    Joe K.

    "Joe_Langley" <joe_langley78...(NoSpam) @ hotmail....com> wrote in message
    news:...
    > This usually means that the user that is attempting to access this does
    > not
    > have the correct permissions...assuming this is a webapp (i believe you
    > said
    > you are using asp.net) the request will have the security context of the
    > webapp...
    >
    > I had a similiar problem trying to access Active Directory...the local
    > ASPNET account does not have enough permissions, so I needed to modify
    > that
    > in the machine.config file.
    >
    > Cheers!
    >
    > "" wrote:
    >
    >> I receive the following error 'Request for the permission of type
    >> System.Security.Permissions.St­rongNameIdentityPermission, mscorlib,
    >> Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e08­9
    >> failed.' when I try to access a property or method of the library. I
    >> was wondering if the library is secure with a key, so the caller has to
    >>
    >> be sign with same key or I'm calling the library incorrectly. Do I need
    >>
    >> an assembly tag with in code?
    >>
    >>
    >> I'm attempting to add functionality to a product by adding inline C#
    >> code to a ASP.Net control. The software does not have a published SDK
    >> but I can determine how to use the libaries from previous versions. Any
    >>
    >> help is greatly appreciated and links to documentation or explanation
    >> are great helps for learning.
    >>
    >>
    >> Many thanks,
    >>
    >> Robert Pottschmidt
    >>
    >>
    >> Below is the code sample:
    >> ....
    >> Software.DataLayer.One a;
    >> Software.BusinessLogic.Two b;
    >> a =(Software.Libary.One) Session["XXXXX"];
    >> a = l.Inbox; //The code blows up here with the above error
    >> ....
    >>
    >>
    >> PermView of the classes:
    >>
    >>
    >> C:\Documents and Settings\rob>permview /decl Software.Libary.dll
    >>
    >>
    >> Microsoft (R) .NET Framework Permission Request Viewer. Version
    >> 1.1.4322.573
    >> Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
    >>
    >>
    >> Class Software.DataLayer.One LinktimeDemand permission set:
    >> <PermissionSet class="System.Security.Permiss­ionSet"
    >> version="1">
    >> <IPermission
    >> class="System.Security.Permiss­ions.StrongNameIdentityPermiss­ion,
    >> mscorlib, Version=1.0.5000.0, Culture=neutral,
    >> PublicKeyToken=b77a5c561934e08­9"
    >> version="1"
    >>
    >>
    >> PublicKeyBlob="002400000480000­094000000060200000024000052534­1310
    >> 0040000010001007F850AB9C51768C­40BB2BC90AC0E7A733B0717D1139F2­BDE487A76A8FA93E887D
    >>
    >> 2CB0B63EF25B401038A7A48CA5DB63­8EFD867515D8219EF8A58F3B1D098C­89C278F6078789564F1F
    >>
    >> 6F6C088729F4D0D3BEE66E923A49B9­A22E3404837A14E5DDB1AC258BB0C1­22329B06E531E05CF2E7
    >>
    >> 214936E57EE0F998BC093AD2C351BB­9"/>
    >> </PermissionSet>
    >>
    >>
    >>
    >>
    >>
    >> Below is the code sample:
    >> ....
    >> Software.DataLayer.One a;
    >> Software.BusinessLogic.Two b;
    >> a =(Software.DataLayer.One) Session["XXXXX"];
    >> b = a.Inbox; //The code blows up here with the above error
    >> ....
    >>
    >>
    >> PermView of the classes:
    >>
    >>
    >> C:\Documents and Settings\rob>permview /decl Software.Libary.dll
    >>
    >>
    >> Microsoft (R) .NET Framework Permission Request Viewer. Version
    >> 1.1.4322.573
    >> Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
    >>
    >>
    >> Class Software.DataLayer.One LinktimeDemand permission set:
    >> <PermissionSet class="System.Security.Permiss­ionSet"
    >> version="1">
    >> <IPermission
    >> class="System.Security.Permiss­ions.StrongNameIdentityPermiss­ion,
    >> mscorlib, Version=1.0.5000.0, Culture=neutral,
    >> PublicKeyToken=b77a5c561934e08­9"
    >> version="1"
    >>
    >>
    >> PublicKeyBlob="002400000480000­094000000060200000024000052534­1310
    >> 0040000010001007F850AB9C51768C­40BB2BC90AC0E7A733B0717D1139F2­BDE487A76A8FA93E887D
    >>
    >> 2CB0B63EF25B401038A7A48CA5DB63­8EFD867515D8219EF8A58F3B1D098C­89C278F6078789564F1F
    >>
    >> 6F6C088729F4D0D3BEE66E923A49B9­A22E3404837A14E5DDB1AC258BB0C1­22329B06E531E05CF2E7
    >>
    >> 214936E57EE0F998BC093AD2C351BB­9"/>
    >> </PermissionSet>
    >>
    >>
     
    Joe Kaplan \(MVP - ADSI\), Jun 21, 2005
    #3
  4. Guest

    Thank you gentelmen and sorry for the slow response.

    I figured it was signed but want to make sure I was ass-u-ming anthing.

    r
     
    , Jun 30, 2005
    #4
    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. Tackie

    Strong Name Key (SNK) File

    Tackie, Oct 21, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    22,352
    Olaf Baeyens
    Oct 26, 2005
  2. Josh
    Replies:
    0
    Views:
    372
  3. SenthilVel

    .Net 2.0 Framework Strong Name Error

    SenthilVel, Jun 16, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    469
    SenthilVel
    Jun 16, 2006
  4. namekuseijin

    Re: "Strong typing vs. strong testing"

    namekuseijin, Sep 27, 2010, in forum: C Programming
    Replies:
    214
    Views:
    3,454
    Nick Keighley
    Oct 17, 2010
  5. namekuseijin

    Re: "Strong typing vs. strong testing"

    namekuseijin, Sep 27, 2010, in forum: Python
    Replies:
    229
    Views:
    3,549
    Gregory Ewing
    Oct 29, 2010
Loading...

Share This Page