HighTechTalks DotNet Forums  

Security problem with Managed Code calling Unmanaged Code in a Web Page

Dotnet Scripting microsoft.public.dotnet.scripting


Discuss Security problem with Managed Code calling Unmanaged Code in a Web Page in the Dotnet Scripting forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
GAH
 
Posts: n/a

Default Security problem with Managed Code calling Unmanaged Code in a Web Page - 07-11-2003 , 02:31 PM






Hello,

I have a web page which contains an ActiveX control (unmanaged) and a
Windows Forms User Control (managed). Both reside on a web page and are
glued using VBScript. The user control raises events which are handled by
the VBScript. This is generating the error "Error: Request for the
permission of type System.Security.Permissions.SecurityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutural, PubliKeyToken=b77a5c561934e089 failed.
Code: 0"

The error is understandable, because managed code needs permission to call
unmanaged code. So I created a new code group with full trust under Machine
level and set the membership to include everything below http://someserver/
URL:

caspol -machine -addgroup All_Code -url http://someserver/* FullTrust -n
MyNewCodeGroup

This didn't seem to help. Turning code access security off entirely solved
the problem. But this is obviously not a safe state to leave the machine
in.

caspol -s off

Am I missing some other permissions? Any suggestion is appreciated.
Thanks!




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.