title: Deploying EF 4.1 code-first ASP.NET MVC3 to medium trust shared hosting
body: <p>I think, this is quite common situation nowadays, so its surprising, that I have troubles finding nice and clean solution for it (even here at SO).</p>
  
  <p>I have my ASP.NET MVC3 web application using Entity Framework 4.1 with code-first approach (using DatabaseInitializer to seed default data). I also tried two database options: SQL Express 2008 R2 and SQL Compact 4. Everything is working fine on local.  </p>
  
  <p>Now I want to host my app so I found <a href="http://www.web4u.cz/webhosting/asp-net-webhosting" rel="nofollow">hosting</a> (middle one called 'optimal') and finally (after some issues) got into state, where I am getting medium-trust error (I believe).</p>
  
  <blockquote>
    <p>The application attempted to perform
    an operation not allowed by the
    security policy.  To grant this
    application the required permission
    please contact your system
    administrator or change the
    application's trust level in the
    configuration file.</p>
  </blockquote>
  
  <p>Let's take as fact that I can't configure that hosting any way and I do not think, that they are going to switch me to full-trust. </p>
  
  <p><strong>What do I have to do, to make my application work on medium-trust hosting?</strong>  </p>
  
  <p>Edit: I have found some answers that are usually propagating setting medium trust at local dev and just do it like that, so my question could now be something like:  </p>
  
  <p><strong>What are "top 5 reasons" why your ASP.NET MVC3 EF 4.1 app won't work at medium-trust?</strong></p>
  
  <p>Edit: I have added bounty to this becuase I would like to see some discussion.. or at least more oppinions/experiences, containing more than just "set medium trust at local dev". Maybe there is nothing to discuss here, but I am just curious because I already spent more time on this than I would like.</p>