Author Tim Stanley - Tim Stanley

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);

Custom Controls In ASP.NET

Feb 26, 2010

ASP.net has that neat little feature where all the controls can start with <asp:.  It makes it easy to code.  I had numerous custom controls and I always had to register the control on each page to use it.  Scott Guthrie had a great tip on how to register the controls in the web.config file so that it doesn’t have to be done in each page.More...

Windows Live Writer XMLRPC and BlogEngine.Net

Feb 26, 2010

BlogEngine.Net supports XMLRPC and the MetaWeblog API.  This allows it to support other tools like Windows Live Writer.  But where are the specifications for the API and WLW found?  I came across some interesting related links along the way in trying to figure out how to add proper slug support for pages in BlogEngine.Net.More...

Exchange Hosting

Jan 29, 2010

Is Software As a Service hype or real.  Microsoft Exchange Server Hosting is not only real, but extremely cost effective. More...

MSDN Style Class Documentation

Jan 20, 2010

NDoc is dead. Long live NDoc! How to generate MSDN style documentation using Sand Castle on Visual Studio 2008. More...

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

Features, Flags, Updates And Branches

Dec 03, 2009

Version control systems are wonderful tools and terrible tools all depending on the process used to manage the files stored in them.  They allow tracking changes, updates, reversing updates, comparing to older updates, and creating multiple branches and variations of files ad-infinitum.  What are good rules to keep good tools from going bad?More...