[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

ActiveX and Microsoft.Office.Interop.Word

(John Giblin)

8/28/2007 3:45:00 PM

I created an activeX control that does a mailmerge. When I run the
page I get the following error message. I have created very simple
activeX controls before. What do i have to do to be able to execute
this control with the "Microsoft.Office.Interop.Word"

thanks in advance

System.Security.SecurityException: That assembly does not allow
partially trusted callers.
at
System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly
asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle
rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at WindowsControlLibrary1.UserControl1.test7()
at WindowsControlLibrary1.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)
The action that failed was:
LinkDemand
The Zone of the assembly that failed was:
Trusted


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
WindowsControlLibrary2
Assembly Version: 1.0.2795.30081
Win32 Version: n/a
CodeBase: http://localhost/test/activextest/WindowsControlLibrary2.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Accessibility
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
Microsoft.mshtml
Assembly Version: 7.0.3300.0
Win32 Version: 7.0.3300.0
CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll
----------------------------------------
Microsoft.Office.Interop.Word
Assembly Version: 10.0.4504.0
Win32 Version: 10.0.4504
CodeBase:
file:///C:/WINDOWS/assembly/GAC/Microsoft.Office.Interop.Word/10.0.4504.0__31bf3856ad364e35/Microsoft.Office.Interop.Word.dll
----------------------------------------
WindowsControlLibrary3
Assembly Version: 1.0.2796.19013
Win32 Version: n/a
CodeBase: http://localhost/test/activextest/WindowsControlLibrary3.dll
----------------------------------------
WindowsControlLibrary1
Assembly Version: 1.0.2795.29918
Win32 Version: n/a
CodeBase: http://localhost/test/activextest/WindowsControlLibrary1.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

1 Answer

Patrick Steele

9/3/2007 2:21:00 PM

0

In article <1188315898.404579.139000@19g2000hsx.googlegroups.com>,
jwgiblin3@hotmail.com says...
> System.Security.SecurityException: That assembly does not allow
> partially trusted callers.

You need to give Full Trust to any assembly that wants to do COM
Interop.

--
Patrick Steele (patrick@mvps.org)
http://weblogs.asp.n...