K
Ken Cox [Microsoft MVP]
Hi folks,
I need some help with an ASP.NET 2.0 page that generates the following error
when it calls a VSTO runtime DLL:
System.Security.SecurityException: That assembly does not allow partially
trusted callers.
My understanding was that for my partial-trust Web application to call a
VSTO strong-named assembly, the assembly needs to be in the GAC. That is,
the GAC grants Full Trust by default.
My ISP (ServerIntellect) kindly installed the VSTO runtimes in the GAC, but
still no luck - same error when I run the code.
What needs to be done in this case? Does the VSTO assembly need to be marked
with the 'allow partially trusted callers' (APTCA) even when in the GAC?
I've put in some repro code below.
Thanks!
Ken
Microsoft MVP [ASP.NET]
(e-mail address removed)
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Configuration" %>
<%@ Import Namespace="System.Web.Configuration" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Common" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="Microsoft.VisualStudio.Tools.Applications.Runtime" %>
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim template() As Byte
Dim sd As
Microsoft.VisualStudio.Tools.Applications.Runtime.ServerDocument
Response.Write(Environment.UserName)
sd = New
Microsoft.VisualStudio.Tools.Applications.Runtime.ServerDocument(template,
".DOC")
End Sub
</script>
I need some help with an ASP.NET 2.0 page that generates the following error
when it calls a VSTO runtime DLL:
System.Security.SecurityException: That assembly does not allow partially
trusted callers.
My understanding was that for my partial-trust Web application to call a
VSTO strong-named assembly, the assembly needs to be in the GAC. That is,
the GAC grants Full Trust by default.
My ISP (ServerIntellect) kindly installed the VSTO runtimes in the GAC, but
still no luck - same error when I run the code.
What needs to be done in this case? Does the VSTO assembly need to be marked
with the 'allow partially trusted callers' (APTCA) even when in the GAC?
I've put in some repro code below.
Thanks!
Ken
Microsoft MVP [ASP.NET]
(e-mail address removed)
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Configuration" %>
<%@ Import Namespace="System.Web.Configuration" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Common" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="Microsoft.VisualStudio.Tools.Applications.Runtime" %>
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim template() As Byte
Dim sd As
Microsoft.VisualStudio.Tools.Applications.Runtime.ServerDocument
Response.Write(Environment.UserName)
sd = New
Microsoft.VisualStudio.Tools.Applications.Runtime.ServerDocument(template,
".DOC")
End Sub
</script>