ReflectionPermission Required for LINQ to SQL under Partial Trust

Posted Monday, January 28, 2008 1:45 PM by CoreyRoth
So by now, I can assume everyone has been listening to me and you are using partial trust in all of your SharePoint environments right?  Ok, probably not, but for the two of you in the world that are, this post is for you.  If you decide to use LINQ to SQL in any of your development, I have discovered that ReflectionPermission is needed by LINQ to SQL.  I don't know the exact permissions it needs yet, but if you are in a bind to get it to work in your partial trust you can use a line like the following.  I try to avoid giving any permission unrestricted access, but until you find out what the underlying class actually needs, it is dificult.  To get you by, use a line like this.

<IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />

Also some more obvious permissions LINQ to SQL will need is SqlClientPermission and probably ConfigurationPermission.

 

 

Comments

No Comments

Leave a Comment

(required)
(required)
(optional)
(required)