Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulating Shared Hosting Trust Levels

I want to simulate the trust levels of a shared hosting environment on my development machine so that there are no nasty surprises when I come to deploy my solution.

I added this my setting the web.config:

<trust level="Medium" originUrl="*"/>

The only problem with this is that I'm getting this exception when I try to save to my database:

InnerException: System.Security.SecurityException Message="Request for the permission of type 'System.Net.SocketPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed." Source="mscorlib"

How do I specifically allow this while still maintaining medium 'like' trust. Are there other things I can resonably allow?. Ill be hosting on GoDaddy.

like image 630
Dan Avatar asked Mar 28 '09 22:03

Dan


1 Answers

I contacted Godaddy, and got this responce:

GoDaddy.com ASP.NET shared hosting servers use the default Medium trust level with the addition of OleDbPermission, OdbcPermission, and a less-restrictive WebPermission.

Applications operating under a Medium trust level have no registry access, no access to the Windows event log, and cannot use reflection. Such applications can communicate only with a defined range of network addresses and file system access is limited to the application's virtual directory hierarchy. Please make sure that your application can work in a Medium trust environment if you are having any problems with it.

So people can use this as an indication of what shared hosting permissions are generally like.

When I figure out how to create these permissions as outlined in @blowdards link ill post them. Or if anyone could post an example that would be great.

like image 179
Dan Avatar answered Sep 28 '22 21:09

Dan