ActiveX control is getting "That assembly does not allow partially trusted callers."

Discussion in 'ASP .Net Building Controls' started by John G, Aug 31, 2007.

  1. John G

    John G Guest

    I have created an ActiveX Control which includes a OfficePia
    Assembly. when I execute it in a browser I get
    "That assembly does not allow partially trusted callers."


    I tried turning off the cas policy using the caspol utilty tool. That
    didnt do anything. when I take out the office pia everything works
    fine.

    I am not sure what I am suppose to do with the
    Microsoft.Office.Interop.Word.dll assenbly. I put it in the same
    directory as the activeX dll.


    Any suggestions is appreciated.

    Here is the entire message:

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    System.Security.SecurityException:
    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
    ----------------------------------------
    WindowsControlLibrary3
    Assembly Version: 1.0.2796.19013
    Win32 Version: n/a
    CodeBase: http://localhost/test/activextest/WindowsControlLibrary3.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
    ----------------------------------------
    WindowsControlLibrary2
    Assembly Version: 1.0.2798.31248
    Win32 Version: n/a
    CodeBase: http://localhost/test/activextest/WindowsControlLibrary2.dll
    ----------------------------------------
    WindowsControlLibrary1
    Assembly Version: 1.0.2795.29918
    Win32 Version: n/a
    CodeBase: http://localhost/test/activextest/WindowsControlLibrary1.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
    ----------------------------------------

    ************** 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.

    microsoft.public.dotnet.framework.interop
    John G, Aug 31, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. g3000
    Replies:
    4
    Views:
    20,000
    Scott Allen
    Jan 19, 2006
  2. Matt Culbreth
    Replies:
    1
    Views:
    518
    bruce barker
    Mar 29, 2007
  3. =?Utf-8?B?TWFydHluIEZld3RyZWxs?=

    That assembly does not allow partially trusted callers

    =?Utf-8?B?TWFydHluIEZld3RyZWxs?=, May 2, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    743
    Steven Cheng[MSFT]
    May 8, 2007
  4. Joris van Lier
    Replies:
    3
    Views:
    904
    Alvin Bruney [ASP.NET MVP]
    Jul 8, 2008
  5. ASF
    Replies:
    1
    Views:
    1,477
    Mr. Arnold
    Jan 13, 2009
Loading...

Share This Page