Tuesday, February 13, 2007

Installing Visual Studio 2005 SP1 on Windows Server 2003

I was trying to upgrade our installation of Visual Studio .NET 2005 to Service Pack 1 last week, when I received an error like this:
Error 1718 - File 1234.tmp was rejected by digital signature policy.

After a bit of Googling, I came across two posts on Heath Stewart's blog which exactly described my problem and provided a workaround. Here's a quick summary of how to install SP1 for Visual Studio 2005 on Windows Server 2003:

1. If you belong to a domain, leave it and reboot your machine.

2. Open up the Registry Editor (Start > Run > regedt32) and navigate to HKEY_LOCAL_MACHINE > SOFTWARE > Policies > Microsoft > Windows > Safer > CodeIdentifiers.

3. With the CodeIdentifiers folder highlighted in the left content pane, check to see if an entry called PolicyScope exists in the right content pane. If it does not yet exist, right-click the CodeIdentifiers folder in the left content pane and select New > Key > DWORD Value. Rename the new item to PolicyScope.

4. Right-click the PolicyScope key in the right content pane, select Modify and change the value to 1.

5. Open up a command prompt (Start > Run > cmd), type net stop msiserver and press Enter to stop the Windows Installer service.

6. Install Service Pack 1 for Visual Studio .NET 2005.

7. If you had to create the PolicyScope key in Step #3, delete it. If the PolicyScope key was already there when you opened up the registry, change its value to 0, using the steps described in Step #3.

8. If you had to leave a domain in Step #1, rejoin it and reboot your machine.

I'm hoping these type of problems go away by the time Service Pack 2 is ready. But for now, I'm just glad I was able to install SP1 without too much difficulty. Thanks, Heath!

Thursday, February 08, 2007

Fixing Intellisense in Web.config

A few days after I began reading Pro ASP.NET 2.0 in C# 2005, I ran into a problem that disabled Intellisense when working in Web.config. It seems I'm not the only one to have experienced this problem: Scott Guthrie and Tim Gaunt, whose blogs I frequent, encountered the same issue.

The problem was that the following line of code in Web.config:
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

Should be:

The xmlns property appears to be inserted every time the Web Site Administration Tool is used. Anyway, I did some digging around and found an answer posted by Massimo Prota in the comments section of Scott Guthrie's blog post about the same problem. Here's what Massimo suggests:

1. Open the folder %windir% \ Microsoft.NET \ Framework \ v2.0.50727 \ ASP.NETWebAdminFiles \ App_Code.

2. In the above folder, open WebAdminPage.cs and in the SaveConfig method (line 93), change the value of config.NamespaceDeclared to false.

UPDATE - Massimo's suggestion didn't fix the problem for me: the xmlns property is still added to my Web.config every time I change something in the IIS Website Name > Properties > ASP.NET > Edit Configuration screen. However, if anybody finds that it does work for them under Windows Server 2003, please let me know...

Thursday, February 01, 2007

In The Beginning...

After using VBScript and Classic ASP to develop web-based applications for the past 8+ years, I've decided to move forward and learn how to use C# and ASP.NET (v2.0) instead. While Classic ASP's relative simplicity made it easy to learn and use, VBScript's lack of advanced features are preventing me from developing web applications that are as robust as I need them to be.

This blog will serve to document my quest to become proficient in the use of the .NET Framework v2.0 (and above), where it applies to web applications development. I'll be avoiding Windows Forms (read: installable applications) almost entirely, as that type of development does not interest me in the least. I will also be coding in C# whenever possible -- VB.NET might be more familiar, but I'd rather start learning a language that uses more C-like syntax, in case I decide to try Java or C++ out at some point going forward.