in

Dot Net Mafia

Group site for developer blogs dealing with (usually) .NET, SharePoint 2013, SharePoint 2010, Office 365, SharePoint Online, and other Microsoft products, as well as some discussion of general programming related concepts.

This Blog

Syndication

Archives

Corey Roth [MVP]

A SharePoint MVP bringing you the latest time saving tips for SharePoint 2013, SharePoint 2010, Office 365, SharePoint Online, MOSS 2007, ASP.NET, LINQ, and Visual Studio 2012.

ReflectionPermission Required for LINQ to SQL under Partial Trust

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)  
(optional)
(required)  
Add

About CoreyRoth

Corey Roth is an Applications Architect at Infusion specializing in ECM and Search.
2012 dotnetmafia.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems