Partial Trust Caller

Partial Trust Caller

Old forum URL: forums.lhotka.net/forums/t/1529.aspx


MadGerbil posted on Wednesday, October 18, 2006

I've got a solution that has a web project and a business object library (vb) - both projects are within the same solution.   The business object library references the CSLA library (csla.dll, csla.serializer.dll) which are compiled and sitting on my workstation.  (I don't include CSLA in my solution).

Now then, in my web application I've decided to tighten up security a wee bit by setting the <trust level="Medium">.  When my application tries to call my business object library (which is signed) it complained at first that the assembly doesn't allow partial trust callers so I gave my assembly the <assembly: AllowPartialTrustCallers()> attribute.

However, when the code gets down into the CSLA library it still throws this error - I put the <assembly: AllowPartialTrustCallers()> onto the CSLA library itself but I get the error yet again in LocalProxy.vb.   The line in red is what blows up.

Namespace DataPortalClient

''' <summary>

''' Implements a data portal proxy to relay data portal

''' calls to an application server hosted locally

''' in the client process and AppDomain.

''' </summary>

Public Class LocalProxy

Implements DataPortalClient.IDataPortalProxy

Private mPortal As Server.IDataPortalServer = _

New Server.DataPortal

......... <snip> .......

Public Function Fetch( _

ByVal objectType As Type, _

ByVal criteria As Object, _

ByVal context As Server.DataPortalContext) As Server.DataPortalResult _

Implements Server.IDataPortalServer.Fetch

Return mPortal.Fetch(objectType, criteria, context)

End Function

IS there a way for me to get this to work with medium level of trust?  I'd like to use the medium level of trust and have my .dlls signed.  Is there another assembly that needs the <assembly: AllowPartialTrustCallers> attribute?

 

ajj3085 replied on Wednesday, October 18, 2006

I believe that Csla requires full trust, because the dataportal requires the use of reflection, which requires full trust.  I don't think there's anyway around this.

MadGerbil replied on Wednesday, October 18, 2006

Egad!

Well, I suppose I could set up a custom trust level - but what a pain in the *** that is!

ajj3085 replied on Wednesday, October 18, 2006

I've updated the faq to include this question.  Please see the Faq, and you can find a link to the thread that explains what the problems are in detail.

MadGerbil replied on Wednesday, October 18, 2006

Many thanks.

Copyright (c) Marimer LLC