Use HostingEnvironment.MapPath

Jun 25, 2010

When running a service under IIS, the HttpContext.Current object is not available, so HttpContext.Current.Server.MapPath will fail.

fileName = HttpContext.Current.Server.MapPath(fileName);

The solution is to use Hosting.HostingEnvironment.MapPath instead.

fileName = System.Web.Hosting.HostingEnvironment.MapPath(fileName);

Field Codes

Jan 02, 2010

Using field codes to replace values in content, templates, and reports allows users and designers a great deal of flexibility for creating and managing content and templates without requiring code changes.

This article is a summary of how to use field codes in content, templates, or reports and how to convert them to object property values and format and replace them when displayed or rendered.  This is based on a similar pattern that Microsoft Word uses when formatting fields.  It’s also commonly used in WordPress and WordPress themes.More...

Date And Time Tracking in .Net

Sep 28, 2009

Getting the right date and time sounds simple enough, but when you look at a few interesting scenarios with multiple teams coordinating actions across multiple time zones with multiple clients and servers, designing for the date and time for a given event becomes complicated very quickly.  I’d like to share an some approaches that I think work well in .Net.More...

Silverlight 2.0 Released

Oct 15, 2008

On October 14, 2008, Microsoft released Silverlight 2.0, the cross-platform browser plug-in for both Macintosh and PC platforms.

Silverlight includes several Rich Internet Application (RIA) features, including:

  • WPF UI Framework
  • Rich Controls
  • Rich  Networking Support
  • Rich Base Class Library More...

Source Control Tools

Aug 06, 2008

H.O. Studley Tool Chest

The limitations of your tools are your limitations. Choose your tools wisely. More...

How to Remove Projects in the Visual Studio Project MRU List

Mar 08, 2008

Visual Studio.Net (2003, 2005 and 2008) keeps a list of recent projects shown on the Start Page in the IDE. Sometimes when moving projects around on the disk, one can end up with duplicate names and this can be confusing. To resolve this, the list in the registry must be updated.

More...