Monday, March 15, 2010

Running .NET 4.0 in IIS 7.5 for the First Time

Today, I tried my hand at running an asp.net 4.0 (release candidate) web app for the first time in IIS 7.5.  I was getting all kinds of errors, the latest one being
Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list
Anyhow, I thought I’d mention on this blog how I got it working.   Turned out .Net Framework 4.0 was not registered properly.  After I did run %windir%\Microsoft.NET\Framework\v4.0.21006\aspnet_regiis.exe –i, everything is working fine.

Saturday, March 13, 2010

Turning a DateTime into a Friendly String

Over at http://www.primershee.com/Forum.aspx, the date column shows a friendly string version of when each post was last updated.  I used the following extension method…

        public static string ToFriendlyString(this DateTime date)
{
if (date.DayOfYear < DateTime.Now.DayOfYear)
return date.ToString();
else
{
TimeSpan span = DateTime.Now.Subtract(date);
if (span.Hours >= 1)
return span.Hours + " Hours Ago";
else if (span.Minutes >= 1)
return span.Minutes + " Minutes Ago";
else return span.Seconds + " Seconds Ago";
}
}

Thursday, March 11, 2010

AddWeekDays Extension Method

Ever need to add week days to a date?  Use this extension method…

 public static DateTime AddWeekDays(this DateTime startDate, int days)
{
DateTime d = startDate;
int i = 1;
while (days >= i)
{
d = d.AddDays(1);
if (d.DayOfWeek != DayOfWeek.Saturday & d.DayOfWeek != DayOfWeek.Sunday)
i++;
}
return d;
}

www.Mild.net Gets A Facelift!

Checkout the new Mild.Net homepage, especially the logo (design by Mona Hennes)!

Tuesday, March 9, 2010

Primershee Free For Now!

I would like to announce that Primershee, my professional project management solution for the self-employed, independent contractors and other solo professionals, is going to be free for now – that is, until we decide it is not going to be free anymore.
So, go ahead and signup and take advantage of this offer.  Primershee is great for estimating and tracking time against your estimates.  It’s also great for keeping track of what your customers owe you.

Tuesday, February 16, 2010

Funcletizer.Funcletize

So, I'm stepping through Microsoft's code using Reflector, trying to debug an "Object reference not set to an instance of an object" error and I come across this line of code...


      query = Funcletizer.Funcletize(query);

Cracked me up.

Thursday, January 21, 2010

Integration of My Blog with www.Mild.net

Welcome www.Mild.net visitors to my blog!  I am copying over a bunch of posts from the old www.Mild.net blog which ran on Graffiti-CMS.  I ended up not using Graffiti-CMS.  I didn't like not having access to the source code.  And I didn't really like having to wrap my head around yet another template engine (NVelocity).   Incidentally, Telligent recently donated the source code to the open source community)

The Chamber of Commerce Business Listing product never got off the back burner.  I had another idea which I thought could be more profitable and I placed all my energy into what is now called Primershee (you can read about that in a previous post).