This error is a problem that is frequently encountered in shared hosting. The error is due to a higher trust level being required in order to run the application. In ASP.NET your “Trust level” defines what level of access your ASP.NET code has to the server. Higher trust levels have a higher level of access to the server itself.
Often you will find that an application you have created on your local development machine will generate this error when uploaded to the shared hosting server. This is due to the fact that in almost all cases you development machine is running your site in what is called “Full Trust mode”. Full trust mode means that your ASP.NET application has unrestricted access to the server. It can read files and folders outside its web root and even do things such as write to the event log in windows.
For obvious reasons it is necessary for the security and stability of the server in a shared environment to limit the access of each individual. So it is fairly standard practice to impose a medium trust setting on ASP.NET sites hosted in a shared environment. This does create some issues with executing certain code on the server but there is almost always a different way to program the application or use a different library to accomplish the exact same task the application is trying to perform but in a way that complies with medium trust. If a Full Trust environment is absolutely necessary, you can contact our support department and they will review your request for an exception for your web application.
An example ASP.NET error page referencing a Full Trust issue: