Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > FAQ > Generated code FAQ> Can I use the generated code in a Medium Trust environment?
 

Pages: 1
Generated code FAQ
Can I use the generated code in a Medium Trust environment?
Page:1/1 

  Print all messages in this thread  
Poster Message
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37233 posts
# Posted on: 05-Apr-2011 11:28:45.  
Starting with the LLBLGen Pro runtime framework build of April 4th, 2011, the generated code of v3.0 and v3.1 can be used in a Medium Trust environment. Medium Trust is sometimes required on shared hosting platforms and cloud service providers like GoDaddy or Rackspace.

.NET 4
For using the generated code in a Medium Trust environment with .NET 4, the following additional action has to be taken to avoid a security exception related to inheritance:

Adapter
Add the following line to the AssemblyInfo.cs/vb class in the generated DbGeneric VS.NET project:

Code:

// C#:
[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]

' VB.NET:
<Assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)>


SelfServicing
Add the following line to the AssemblyInfo.cs/vb class in the generated VS.NET project:

Code:

// C#:
[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]

' VB.NET:
<Assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)>


Linq
To use Linq, the service provider has to have enabled ReflectionPermission to be unrestricted. This is in general the case, as Entity Framework and Linq to Sql require this setting to be unrestricted. It's a change in the Medium Trust level, so it's not enabled by default when the default Medium Trust is selected. If your service provider doesn't want to enable ReflectionPermission to be unrestricted, you have to use our native query API instead of Linq. Linq uses compiled lambda's and this .NET 3.5 feature requires ReflectionPermission to be unrestricted.
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.