Before starting to use Personal Web Site Starter Kit (PWS), I had a hosting package with 1and1. I assumed, because the package supported .Net, I would be able to use 1and1 to host PWS. Well, most of my development is for corporate environments, so I typically can run applications in Full Trust. The limitations of Medium Trust were all new to me.
I was forced to learn a little bit about Medium Trust because PWS would sporadically generate an Exception when using 1and1 Hosting...
Here is part of the stack trace exception, "System.Security.Permissions.FileIOPermission"...
Here are some links that were helpful for me when learning about ASP.Net and Medium Trust:
How To: Use Medium Trust in ASP.Net 2.0
Medium Trust ASP.NET Applications
Hosting ASP.NET Applications in Medium Trust
Security Exceptions
Medium Trust Issue in ASP.Net 2.0
I knew my exception was related to File IO, but it was sporadic/inconsistent and the code was not doing anything special. I saw in the Stack Trace that the Site Map Provider was involved.
To try and work around the exception, I wrote a custom provider that derived from the XmlSiteMapProvider and overrode the IsAccessibleToUser method so that it did not access the file system. This seemed to reduce the frequency, but the problem was not gone.
Next, I set SecurityTrimmingEnabled to false. Again, this seemed to further reduce the frequency, but the problem was not gone. I read that the XmlSiteMapProvider monitors the file system for any changes to the XML file.
At this point, I was going to lose a lot of functionality, so I decided to look for another place to host my application. I checked out GoDaddy.com. Here is what each said about Trust level..
1and1 FAQ: Restrictions in hosting ASP.Net applications
Godaddy FAQ: What Is Medium trust level and how does it affect my hosting account?
I have since moved to GoDaddy without any problems.