October 2009 Blog Posts
Working with identity column seed & increment values
Learn how to find the current identity value of an identity column, how to change the seed & increment values, as well as how to retrieve the maximum and minimum values.
Solving access denied errors using Process Monitor
Access denied errors are not uncommon when deploying new websites / features that interact with the filesystem. While it might work in local testing, it suddenly doesn't anymore when deployed. Using Process Monitor I'll show how to easily debug these issues. I've made a very simple web application project with a Default.aspx file that has the following codebehind code: using System;
using System.IO;
using System.Web.UI;
namespace FileWritingWebsite
{
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
File.WriteAllText(@"C:\Test.txt", "Hello world!");
Response.Write("Done!");
}
}
}
After deploying this to my webserver we receive the archetypical access denied error:
In this case it's rather obvious where the error stems from,...
How to do URL rewriting on IIS 7 properly
One of my earlier blog posts, and the all time most popular one, was about how to make URL rewriting on IIS 7 work like IIS 6. While my method did provide a means to the goal, it's humiliatingly far from what I should've done. Since the old post is still the most visited post on my blog I feel obligated to write a followup on how to do proper url rewriting in IIS 7. The scenario I'll assume a completely vanilla IIS 7 setup, contrary to the old post, there's no IIS tampering required. I've setup...
Simple file synchronization using robocopy
On numerous occations I've had a need for synchronizing directories of files & subdirectories. I've used it for synchronizing work files from my stationary PC to my laptop in the pre-always-on era (today I use SVN for almost all files that needs to be in synch). Recently I needed to implement a very KISS backup solution that simply synchronized two directories once a week for offsite storing of the backup data. While seemingly simple the only hitch was that there would be several thousands of files in binary format, so compression was out of the question. All changes would...
|