Web Application, Web Service, Class Libraries, and StrongNameIdentityPermissionAttribute Class

Discussion in 'ASP .Net' started by Mythran, Aug 23, 2005.

  1. Mythran

    Mythran Guest

    I have the following setup:

    BLL Project
    Category.vb
    AssemblyInfo.vb

    Schema Project
    Category.xsd
    AssemblyInfo.vb

    Web Service Project
    CategoryService.asmx
    AssemblyInfo.vb

    Web Application Project
    WebServiceTest.aspx
    AssemblyInfo.vb


    In the BLL project's AssemblyInfo, I have the following:

    <Assembly: AssemblyKeyName("...")>

    and in it's Category.vb class:

    < _
    Transaction(TransactionOption.Required), _
    StrongNameIdentityPermission( _
    SecurityAction.Demand, _
    PublicKey := "..." _
    ) _
    > _

    Public Class Category
    ...


    In my Web Service and Web Application projects, I have the following in
    AssemblyInfo.vb files:

    <Assembly: AssemblyKeyName("...")>

    The key name matches the same key name in the BLL project's AssemblyInfo.vb
    file. I have installed the strong-name key into the CSP and get the public
    key from the dll using secutil -hex -s myassembly.dll which I place into the
    StrongNameIdentityPermission attributes constructor for the Category Class
    definition.

    Anywho, the problem is, when I build and then run the application, I get the
    following:
    Server was unable to process request. --> Request for the permission of type
    System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
    Version=1.0.5000.0, Culture=neutral, PublicKeyToken=... failed.

    Anyone have any idea how to get the StrongNameIdentityPermissionAttribute
    class to work correctly? I do not want SecurityAction.LinkDemand, just
    SecurityAction.Demand.

    Thanks,
    Mythran
    Mythran, Aug 23, 2005
    #1
    1. Advertising

  2. Mythran

    Mythran Guest

    "Mythran" <> wrote in message
    news:...
    >I have the following setup:
    >
    > BLL Project
    > Category.vb
    > AssemblyInfo.vb
    >
    > Schema Project
    > Category.xsd
    > AssemblyInfo.vb
    >
    > Web Service Project
    > CategoryService.asmx
    > AssemblyInfo.vb
    >
    > Web Application Project
    > WebServiceTest.aspx
    > AssemblyInfo.vb
    >
    >
    > In the BLL project's AssemblyInfo, I have the following:
    >
    > <Assembly: AssemblyKeyName("...")>
    >
    > and in it's Category.vb class:
    >
    > < _
    > Transaction(TransactionOption.Required), _
    > StrongNameIdentityPermission( _
    > SecurityAction.Demand, _
    > PublicKey := "..." _
    > ) _
    >> _

    > Public Class Category
    > ...
    >
    >
    > In my Web Service and Web Application projects, I have the following in
    > AssemblyInfo.vb files:
    >
    > <Assembly: AssemblyKeyName("...")>
    >
    > The key name matches the same key name in the BLL project's
    > AssemblyInfo.vb file. I have installed the strong-name key into the CSP
    > and get the public key from the dll using secutil -hex -s myassembly.dll
    > which I place into the StrongNameIdentityPermission attributes constructor
    > for the Category Class definition.
    >
    > Anywho, the problem is, when I build and then run the application, I get
    > the following:
    > Server was unable to process request. --> Request for the permission of
    > type System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
    > Version=1.0.5000.0, Culture=neutral, PublicKeyToken=... failed.
    >
    > Anyone have any idea how to get the StrongNameIdentityPermissionAttribute
    > class to work correctly? I do not want SecurityAction.LinkDemand, just
    > SecurityAction.Demand.
    >
    > Thanks,
    > Mythran
    >
    >
    >


    Gah! Just found:

    Note: Issuing a full stack walk demand for the
    StrongNameIdentityPermission does not work if your assembly is called by a
    Web application or Web service. This is because it is not possible to strong
    name the dynamically compiled classes associated with ASP.NET Web
    applications or Web services.

    That stinks...so SecurityAction.Demand won't work on
    StrongNameIdentityPermissionAttribute :( So, guess I have to use LinkDemand
    :(

    Mythran
    Mythran, Aug 24, 2005
    #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. Karsten Wutzke
    Replies:
    21
    Views:
    915
    Roedy Green
    Jun 29, 2007
  2. Sriram Srinivasan
    Replies:
    13
    Views:
    561
    Benjamin Kaplan
    Nov 12, 2009
  3. DNB
    Replies:
    1
    Views:
    254
  4. Peter Stojkovic
    Replies:
    0
    Views:
    475
    Peter Stojkovic
    Mar 30, 2006
  5. DNB
    Replies:
    1
    Views:
    307
    John Saunders [MVP]
    Jan 20, 2008
Loading...

Share This Page