So, in the past when I wanted to allow a user to impersonate using the .NET framework, I had to go into the frameworks directory (i.e. "C:\Windows\Microsoft.NET\Framework\v2.0.50727") and grant the impersonating user rights to read and write to the correct directory. However, in Windows Vista the rights to these directories are locked down and you might get an error such as the following...The current identity (DOMAIN\USERNAME) does not have write access to 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'. The way to get around this error (if you are using .NET 2.0 or higher is to use the aspnet_regiis utility. I first read about this process here in a response to this blog (http://www.troolean.nl/blog/index.php?entry=entry071023-224210), but there are some gotchas, the biggest being that this only works for ASP.NET 2.0 and higher. The steps to doing this are as follows:
1) Go to your command prompt and runas Administrator
2) Run the following commandline "aspnet_regiis -ga "DOMAIN\USERNAME"
and you should be set...bear in mind that when you're using the utility that you are also giving rights to the metabase as well. You should be very careful to ensure that you are using the lowest possible privelages possible. The link to the aspnet_regiis utility is here (http://technet.microsoft.com/en-us/library/k6h9cz8h(VS.80).aspx).
Happy Hunting,
Toby