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

From: AFN (DELETEnewsgroupCAPSaccount_at_yahoo.com)
Date: 06/11/04

  • Next message: Harry Simpson: "Re: Valid Certificate Authority"
    Date: Thu, 10 Jun 2004 22:29:22 GMT
    
    

    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?


  • Next message: Harry Simpson: "Re: Valid Certificate Authority"

    Relevant Pages

    • "COM Interop Registration Failed. Access is Denied" Message
      ... What is causing this, and how can I fix it? ... The salient facts for this solution are as follows:- ... The COM component is registered correctly and works without error in VB6 ...
      (microsoft.public.vsnet.general)
    • Re: problem with VB6 webbrowser control after installing IE7
      ... I didn't try VB6 itself until just the other day ... In VB6 when running an app that uses the webbrowser control, ... I also uninstalled and reinstalled IE7. ... I know that uninstalling IE7 is one way to fix this ...
      (microsoft.public.vb.general.discussion)
    • Re: IDE-Absturz nach Scrollen
      ... >> Der Fix währe dann wohl kostenpflichtig, ... > bezahlte Software nachweislich einen vom Hersteller verursachten Fehler ... dass VB6 unter Windows XP problemlos ...
      (microsoft.public.de.vb)
    • Re: Read info from a file
      ... Doug. ... > can try to fix it yourself by opening it in VB6 and once past the errors ...
      (microsoft.public.vb.syntax)
    • VB.NET Assembly denied access to System.Web. Help!
      ... I have a VB6 Windows Form application that calls a VB.NET Assembly. ... .net security configuration to fix this. ... What can I do to fix this security problem? ...
      (microsoft.public.dotnet.framework)

  • Quantcast