Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Security problem with Managed Code calling Unmanaged Code in a Web Page

Thread Tools

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

Posts: n/a

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/

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

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

caspol -s off

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

Reply With Quote

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
mixing unmanaged and managed c++ code frank C++ 3 01-22-2007 04:17 PM
Re: How port unmanaged code to .NET development environment (managed)? Laurent Bugnion ASP .Net 0 12-06-2006 08:13 PM
Calling Managed functions from unmanaged class Amit Dedhia C++ 5 10-24-2006 01:43 PM
managed C++ Webservice and unmanaged code Jürgen Tabert ASP .Net Web Services 0 06-03-2005 03:21 PM
Managed and Unmanaged Code Confusion =?Utf-8?B?U2FuZHk=?= ASP .Net 2 10-26-2004 01:25 PM