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

  • Thread starter Thread starter AFN
  • Start date Start date
A

AFN

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?
 
Your application is running with partial trust somehow. Is it being run
from a network share?

Joe K.
 
Back
Top