Calender
<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

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

Security_Exception_PWS

Here is part of the stack trace exception, "System.Security.Permissions.FileIOPermission"...

Stack_Trace_PWS 

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.

My initial interest in the Personal Web Site Starter Kit (PWS) was the photo gallery functionality that was included.  But I have found a little time here and there to make some minor customizations.

First, if you are just starting to use PWS, here are some links for key background information...

Personal Web Site Download

Introduction to the Personal Web Site Starter Kit

Extending the Personal Web Site Starter Kit

 

Second, here are the minor customizations I have done and supporting links...

Convert Personal Web Site Starter Kit to Web Application Project (WAP): I am much more familiar and comfortable with WAP development model, so making this change was a must.  The WAP model is similar to the way things worked with Web Projects in Visual Studio 2003.

Use SQL Server 2005 with Personal Web Site Starter Kit: This was necessary because my and many other hosting providers do not allow SQL Server Express Edition.

Customizing Personal Web Site Starter Kit to Save Photos to the File System: This was needed to take advantage of my available hosting space.

Other Small Customizations: Added category attribute to the albums; Modified Handler.ashx to allow for direct file downloads of original image files; Basic integration with BlogEngine.Net and Slide.Show (cool Silverlight application), which I can detail in a future entry.

 

If you are not into doing customizations yourself, I have come across a number of enhanced versions of PWS that are available...

http://www.willyd.ca/Default.aspx

Extended Personal Web Site Starter Kit

Extended Personal Web Site Starter Kit on CodePlex

http://www.edream.org/BlogArticle.aspx?RecordID=108 

This is my first entry in the blog.  It was a little bit of an effort to get it installed and configured the way I want along with Personal Web Site Starter Kit.  But now that it is done, I am happy with the set up.