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

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?
 
J

Joe Kaplan \(MVP - ADSI\)

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

Joe K.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top