Do you know the stuff that Medium Trust stops you against doing? For instance, I have already found that Medium Trust stops you against using System.IO.Path.GetTempPath(). The other such things as that?
Here's how you can find out about and resolve trust issues.
1) Search your WindowsMicrosoft.NETFramework[YOUR VERSION]CONFIG folders for that files:
- web.config (this is actually the root config file)
2) Alter the web.config to express
<trust level="Medium" originUrl="" />
3) Try your ASP.Internet application. Mine unsuccessful having a permission error.
4) Diff the net_mediumtrust.config and web_hightrust.config inside a diff tool, like WinMerge.
5) Copy configurations in the high towards the medium individually and find out the way they affect your application. During my situation, the mistake message known to ConfigurationPermission, therefore it was simple to identify.
If you're able to pin lower the particular lines within the web_mediumtrust.config file which are obstructing you, maybe you are able to share by using your webhost and also have a better possibility of working things out.
More documentation here:
@Oli, my application IS located at GoDaddy and that i needed to perform some workarounds in code after i began using Lucene.Internet; I needed to customize the Lucene.Internet source code not to use GetTempPath and System.IO.FileInfo.
Who can be certain? That's why you need to develop having a trust degree of medium occur your internet.config.
<trust level="FullHighMediumLowMinimal" />
Most shared hosts avoid using a genuine medium trust atmosphere since it limits things that are simply too vital. Others restrict additional configurations for his or her own rectal reasons.
The very best factor you should do is request your host what configurations they will use for ASPNET. Request for that specs from the trust level they are using. Discover the memory limits. Once you have individuals particulars you need to have the ability to replicate the scenario in a local level.
When they will not let you know, just set your application to operate in medium trust however it (clearly) will not always work if they are utilizing a modified trust level.
Generally the only real problem I have encounter is: If you are pushing devices, make certain you permit partly reliable demands (this is an Set up meta-tag) or else you will not have the ability to rely on them.
Here's an extract of GoDaddy's Medium Trust information page:
Programs operating within Medium trust level don't have any registry access, no use of the Home windows event log, and can't use ReflectionPermission (but could use Reflection). Such programs can communicate just with a definite selection of network addresses and file system access is restricted to the application's virtual directory hierarchy.
Utilizing a Medium trust level prevents programs from being able to access shared system assets and removes the possibility of application interference. Adding OleDbPermission and OdbcPermission enables programs to make use of individuals data companies to gain access to databases. WebPermission is modified to permit outgoing http and https traffic.
That may not map exactly as to the you will need to deal with together with your host (unless of course you are with GoDaddy) but it is an average example.
Make certain any 3rd party libraries/frameworks (Castle involves mind) are build (or could be built) in medium trust.