This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi All, Recently, I tried to introduce LightSpeed ORM into my ASP.NET project. But when I set the medium trust level (<trust level="Medium" />) in my web.config, it would show SecurityException when the query was executed. I thought that is caused by LINQ which had been introuced by LightSpeed ORM, does anyone who has ever encounter the same problem? Thanks, Leo Bi |
|
|
Hello Leo, I have used LightSpeed on Go-Daddy. I made sure that I was using the medium trust in the config, but you also need to specify that you are using medium trust on the LightSpeedContext (either in the code, or in the config). See more details here: http://www.mindscapehq.com/blog/index.php/2009/02/15/running-lightspeed-under-medium-trust/ I hope that helps, John-Daniel Trask |
|
|
I had the same problem and boy did it take me a while to wrap my head around it. The problem is not with LINQ, but the fact that lightspeed (by default) uses Systems.Reflection internally to work the way it does. Medium trust by default does not allow System.Reflection. Your two options here are: Go with godady's virtual private server (that's what I opted for) and set your application pool to either low trust or change the configuration for medium trust to enable Systems.Reflection Or choose "medium trust compatibility" in LightSpeed. be warned tho: Systems.Reflection makes lightspeed superfast (I hope i'm not wrong on this!) so setting it to medium trust compatibility will come at some performance costs. |
|
|
Hi John-Daniel,
I followed the detailed instruction, then it came into this exception "System.Security.SecurityException: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed." During further investigations, I found that my lightSpeedContexts Section in web.config is lack of the key-value pair (requirePermission="false") under the Medium Trust Level. (Obviously, the LightSpeedVideo.wmv tutorial didn't take into this very situation) Now, it runs well:)
Thank you, Leo Bi |
|
|
Hi SR8, I agree with you, it seems that my project would be a little slower when using LightSpeed in Medium Trust Level, but it is okay for me:) Thanks, Leo Bi |
|