Haveing problem embedding Win Form control in IE with managed C++ assembly.



I have been trying to embed a C# .NET Windows Forms User Control into IE
using the <object> tag with a dependency on a managed C++ assembly. I
basically wrote a very simple test control in C# that has a button that
calls into a managed C++ assembly that just returns a string object.

The control works fine until I try to call into the managed C++ assembly
from within the C# User Control. When the call is made, I get an exception
that appears to be security related. I tried turning off CAS security using
CasPol -s off, but I still get the exception (see below). Why can't I call
a managed C++ assembly from within my control? I have checked directory
permissions and dependencies and everything seems to be in order.

I would really like to get this to work, but the Managed C++ dependency
(which I need to have) is really impeding my progress to get this to work.





************** Exception Text **************
System.IO.FileLoadException: Could not load file or assembly
'TestManagedLib, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or
one of its dependencies. Failed to grant minimum permission requests.
(Exception from HRESULT: 0x80131417)
File name: 'TestManagedLib, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null' ---> System.Security.Policy.PolicyException: Required
permissions cannot be acquired.
at System.Security.SecurityManager.ResolvePolicy(Evidence evidence,
PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
PermissionSet& denied, Boolean checkExecutionPermission)
at System.Security.SecurityManager.ResolvePolicy(Evidence evidence,
PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
PermissionSet& denied, Int32& securitySpecialFlags, Boolean
checkExecutionPermission)
at TestLib.UserControl1.button1_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)






--
---------------------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
MailID = varnk
Domain = diebold.com
---------------------------------------------


.


Loading