views:

137

answers:

2

I have an application that is using .net's Entity Framework. This application runs fine on my local machine and my local server. However, trying to run the app on mosso which runs in medium trust returns an error. alt text

I am not sure how to appropriately use entity framework in medium trust. I have the entity model in a separate project from the web app. Any help or direction would be appreciated.

+1  A: 

Entity Framework works on medium trust for me just fine. You can simulate medium trust on your local box by adding <trust level="Medium"> to your web.config file. If it still works on your box (I bet it will), then Mosso very likely has a modified definition of medium trust and disallows something that Entity Framework requires. And at that point you'd have to take it up with them or find different hosting.

Andrew Arnott
+2  A: 

This is strange, I've been successfully using Entity Framework in RackspaceCloud for close to six months now. The entity model being in a separate project should have no effect.

Can you give an example of the calling code which causes this exception?

Are you impersonating your Windows account? e.g.

<identity impersonate="true" userName="dfw\<USERNAME>" password="<PASSWORD>"></identity>

You can find the RackspaceCloud Medium Trust guidelineshere

I did a blog post a while ago detailing requirements for hosting on RackspaceCloud

willbt
I called using LINQ queries. Specifically FirstOrDefault. Any thoughts?
Jeremy
There's nothing in the CloudSites security policies that should prevent this. I would talk to their support guys. Have you tried a non-linq function such as loading an entity by it's key?
willbt