VB.NET Assembly denied access to System.Web. Help!

Discussion in 'ASP .Net Security' started by AFN, Jun 10, 2004.

  1. AFN

    AFN Guest

    I have a VB6 Windows Form application that calls a VB.NET Assembly. I can
    successfully call any test method in the assembly (like return "hello
    world"), but one method in the assembly uses calls to
    System.Web.HttpUtility.UrlEncode. That causes this error to be returned
    back to the VB6 app:

    Request for the permission of type System.Web.AspNetHostingPermission,
    System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    failed.

    I don't know if it is related to vb6 being the calling app or not. I
    haven't tried working around vb6 for testing because I have to call it from
    vb6 anyway. How can I resolve the above problem? I don't know much about
    ..net security configuration to fix this. An old newsgroup post suggested I
    add this code before the UrlEncode method line, but this didn't help:

    Dim Perm As New
    System.Web.AspNetHostingPermission(System.Security.Permissions.PermissionSta
    te.Unrestricted)
    Perm.Assert()

    What can I do to fix this security problem?
    AFN, Jun 10, 2004
    #1
    1. Advertising

  2. Your application is running with partial trust somehow. Is it being run
    from a network share?

    Joe K.

    "AFN" <> wrote in message
    news:6h5yc.8116$...
    > I have a VB6 Windows Form application that calls a VB.NET Assembly. I

    can
    > successfully call any test method in the assembly (like return "hello
    > world"), but one method in the assembly uses calls to
    > System.Web.HttpUtility.UrlEncode. That causes this error to be returned
    > back to the VB6 app:
    >
    > Request for the permission of type System.Web.AspNetHostingPermission,
    > System, Version=1.0.5000.0, Culture=neutral,

    PublicKeyToken=b77a5c561934e089
    > failed.
    >
    > I don't know if it is related to vb6 being the calling app or not. I
    > haven't tried working around vb6 for testing because I have to call it

    from
    > vb6 anyway. How can I resolve the above problem? I don't know much

    about
    > .net security configuration to fix this. An old newsgroup post suggested

    I
    > add this code before the UrlEncode method line, but this didn't help:
    >
    > Dim Perm As New
    >

    System.Web.AspNetHostingPermission(System.Security.Permissions.PermissionSta
    > te.Unrestricted)
    > Perm.Assert()
    >
    > What can I do to fix this security problem?
    >
    >
    Joe Kaplan \(MVP - ADSI\), Jun 11, 2004
    #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. Matt
    Replies:
    2
    Views:
    825
    Matt Getting
    Jul 24, 2003
  2. Randy Paez

    Access Denied ... <add assembly="*">

    Randy Paez, Nov 20, 2003, in forum: ASP .Net
    Replies:
    8
    Views:
    3,195
    fokko
    Mar 10, 2010
  3. Brent
    Replies:
    2
    Views:
    668
    Brent
    Apr 8, 2004
  4. Rick
    Replies:
    1
    Views:
    565
    Walter Wang [MSFT]
    Sep 10, 2007
  5. Chris Herring
    Replies:
    0
    Views:
    181
    Chris Herring
    May 4, 2005
Loading...

Share This Page