medium-trust

How to write to Web.Config in Medium Trust ?

Uploading my first decently sized web app to my shared host provided me with a fresh set of challenges, by which I mean, sleepless nights. The issue was that I had most certainly not developed my application for medium trust (or had any clue what that was.) I mitigated all of the issues, save one. I had written an installer for the a...

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 zone for DST. This probably isn't even a valid scenario unless I have some very robust...

ASP.Net Medium Trust setup

I am trying to configure the IPermission node as part of medium trust. However I am unable to find the valid values list for the PathDiscovery attribute on the node <IPermission class="FileIOPermission" version="1" Read="$AppDir$" Write="$AppDir$" Append="$AppDir$" PathDiscovery="$AppDir$"/> I need to set the permission so that the ac...

Subtext install gives error in Medium trust level.

I am trying to install Subtext in a medium trust level environment (host: Crystaltech) and am getting the following error (see below). I was able to do the administration setup but when it tries to go to the blog for actual use, boom. I know I could "upgrade" the environment to a full trust level but I want to understand why the error ...

Options for in-process databases under medium trust

I have seen a few different in-process SQL databases for .NET (including one from Microsoft), but either they do not work under medium trust (ASP.NET) or the documentation/websites don't even talk about. What experiences have you had with in-process databases in general, and do you know of any that work under medium trust for ASP.NET? ...

.NET 2.0 and MySql in medium trust mode

how do i access Mysql from an ASP.NET 2 site in medium trust mode? My ISP wont allow my site to run under full trust and i've tried many(if not all) mysql apis to connect to the db. All result in either SocketPermission or FileIOPermission errors. i have even tried overriding the trust setting in my web.config. Any ideas? ...

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 can't even call File.GetAccessControl, let alone File.SetAccessControl, but I don't nee...

Calling internal methods in Medium Trust

I have the requirement to call an internal method of a 3rd party object (I cannot make it public for example). I can do that via reflection. Unfortunately this does not work in ASP.NET Medium trust due to insufficient rights: <IPermission class="ReflectionPermission" version="1" Flags="RestrictedMemberAccess"/></PermissionSet> Is ther...

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, the info is once again shown so that he can confirm Once confirmed the info is persisted...

What are the most common, typical things to AVOID coding into my ASP.NET app in order for it to run under Medium Trust on a shared host?

What are the things that Medium Trust stops you from doing? For example, I've already learned that Medium Trust stops you from using System.IO.Path.GetTempPath(). What other things like that? ...

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 = (FormsAuthenticationModule)context.Modules["FormsAuthentication"]; faModule.Authenticate += new Form...

Exception When Using Entity Framework On GoDaddy

I am trying to use the Entity Framework in an ASP.NET application hosted at GoDaddy. I keep receiving the following error: Description: 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 ...

Why does simple array and Linq generate VerificationException: Operation could destabilize the runtime

A very simple ?: operator in C#, combined with a simple array and LINQ (to Objects) call to Reverse() is apparently enough to cause the exception "System.Security.VerificationException: Operation could destabilize the runtime." when run on an ASP.NET web site running with "High" trust (note that "Full" is the default) Here is the code, ...

Redirecting from Global.asax in Medium Trust

I am attempting to do a redirect in the Application_Error handler in Global.asax. Nothing fancy at all. private void Application_Error(object sender, EventArgs e) { // ...snip... Server.Transfer(somePath, false); // ...snip... } This works great under Full trust, but I need to get it to work under Medium trust. The code I'm...

nhibernate proxy generator

I am attempting to get nhibernate working in medium-trust. What I found said that I needed to use a proxy generator. I pulled the one from nhibernate's site. When I attempt to use it, I recieve an error that it could not load the assembly 'DynamicProxyGenAssembly2'. Is there something I am missing or is there one that works somewhere...

RDLC Medium Trust

Does anyone know of a free (for a non-profit group) RDLC reporting tool that will work under medium trust in IIS 7? ...

.Net Hosting (Flexable Medium Trust)

Any recommendations for cheap .Net hosting that has flexible medium trust rules allowing the use of reflection? ...

Problems with MVC Controllers + Dependency Injection (Ninject) in medium trust

I want to use dependency injection in an medium trust environment. To that aim I picked Ninject as Iv been told its light weight. How do I set-up injection into the controllers? When I tried to create a custom controller factory: public class NinjectControllerFactory : DefaultControllerFactory { private readonly IKernel...

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 dat...

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? ...