Questions tagged [medium-trust]

Medium trust is the default trust level in ASP.NET. It prevents applications from accessing shared system resources and eliminates the potential for application interference.

Trust level refers to permissions set in the Web.config file (see ) that dictate what operations can and cannot be performed by Web applications. ASP.NET 3.5 and 4.0 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 ReflectionPermission (but can 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.

Using a Medium trust level prevents applications from accessing shared system resources and eliminates the potential for application interference. Adding OleDbPermission and OdbcPermission allows applications to use those data providers to access databases. WebPermission is modified to allow outbound http and https traffic.

145 questions
6
votes
3 answers

Which IOC Container runs in medium trust

Hi I am trying to get a website running with Mosso that has Castle Windsor as my IOC, however I am getting the following error. [SecurityException: That assembly does not allow partially trusted callers.] GoldMine.WindsorControllerFactory..ctor()…
Rippo
  • 22,117
  • 14
  • 78
  • 117
5
votes
2 answers

Anonymous type in medium trust, works with Reflection not with Expressions

I'm doing custom projections on Linq queries in Medium Trust and I get a MethodAccessException or TypeAccessException complaining about reflection and security rights. I've simplified the code to the following: var anon1 = new { Name = "Bill Gates"…
Yona
  • 9,392
  • 4
  • 33
  • 42
5
votes
1 answer

How to determine if the current application is Medium Trust

I am trying to make sure my ASP.Net library will work under Medium Trust. I'm having problems however in that I need to disable a bit of code if it is being run under medium trust. How do I determine from C# if the current application is medium…
Earlz
  • 62,085
  • 98
  • 303
  • 499
5
votes
1 answer

What's medium trust level?

Could any body simply tell me what Medium Trust level is ? And what does it mean : "More and more ASP.NET hosting providers are enforcing a Medium Trust Policy on their servers.Therefore it is important to make your website work (as much as…
Mostafa
  • 3,002
  • 10
  • 52
  • 79
5
votes
5 answers

Medium-Trust File I/O permission

According to this MSDN article about medium trust, under medium-trust: FileIOPermission is restricted. This means you can only access files in your application's virtual directory hierarchy. Your application is granted Read, Write, Append,…
Omar
  • 39,496
  • 45
  • 145
  • 213
5
votes
2 answers

How do I load a file from bin folder in ASP.NET in medium trust

I need to load an xML file from the bin folder in ASP.NET (MVC, not that it would count). I can't get the bin folder path nor load the file otherwise.. I need to feed the following method : using(var file = System.IO.File.OpenRead(/* something…
Andrei Rînea
  • 20,288
  • 17
  • 117
  • 166
5
votes
4 answers

Storing temporary user files in ASP.NET in medium trust

I have a scenario where users of my ASP.NET web application submit testimonials consisting of text info and images. The submit process has the following steps: First the user inputs the content and chooses a path to an image When he clicks preview,…
Slavo
  • 15,255
  • 11
  • 47
  • 60
5
votes
2 answers

NHibernate 2.1.2 in medium trust

I'm trying to configure nhibernate 2.1.2 to run in medium trust, without any luck. I have tried follwing the suggestions to run in medium trust and pre-generating the proxies. I then tried to remove all references to lazy loading setting the…
John
  • 237
  • 2
  • 6
5
votes
2 answers

Can I make a folder writeable in Medium trust?

My web app writes to several folders (logs, uploads, etc), and I've always set these permissions manually through my hosting provider. I'd like to create a setup script that performs this on new installations. Is this possible under Medium trust? I…
harpo
  • 41,820
  • 13
  • 96
  • 131
3
votes
1 answer

NHibernate 2 + Fluent Nhibernate medium trust

Will NHibernate 2 and\or Fluent Nhibernate work in a medium trust environment. If not are there any work-arounds?
Dan
  • 29,100
  • 43
  • 148
  • 207
3
votes
1 answer

Modify configuration section programmatically in medium trust

I have a custom ConfigurationSection in my application: public class SettingsSection : ConfigurationSection { [ConfigurationProperty("Setting")] public MyElement Setting { get { return…
Omar
  • 39,496
  • 45
  • 145
  • 213
3
votes
5 answers

How can I determine whether a given date is in Daylight Saving Time for a given timezone in .NET 2.0?

I'm on .NET 2.0, running under Medium Trust (so TimeZoneInfo and the Registry are not allowed options). I'm asking the user for two dates and a time zone, and would really love to be able to automatically determine whether I need to adjust the time…
bdukes
  • 152,002
  • 23
  • 148
  • 175
3
votes
3 answers

Is there a way to digitally sign a document on Medium Trust hosting?

The hosting server just wont execute: SignedXml.ComputeSignature(); I thought fromXML and toXML methods required full trust. But this came as a surprise. Now it is impossible to digitally sign any document. On searching the net I found this: Using…
A G
  • 21,087
  • 11
  • 87
  • 112
3
votes
1 answer

How can I hook into the current FormsAuthenticationModule in a Medium Trust environment?

I've got an HttpModule in my application that hooks into the FormsAuthenticationModule's Authenticate event with the following code: public void Init(HttpApplication context) { FormsAuthenticationModule faModule = …
Greg Hurlman
  • 17,666
  • 6
  • 54
  • 86
3
votes
0 answers

Asp.Net MVC Applictaion Not running on Medium Trust Level

Trying to deploy Asp.net MVC application on Big-rock hosting Server but Big-rock hosting Server not allow .Application properly run on my local machine with . I have placed in my…
1
2
3
9 10