Monday, December 11, 2006
Direct download for popular Visual Studio 2005 hot fixes

In an unexpected move Microsoft created a website with download links for available Visual Studio 2005 hot fixes that were previously available only through Microsoft Developer Support. This is great news because there was little visibility over what hot fixes existed for certain problems with Visual Studio.

The list of available hot fixes for download can be found here. Some of them address corner cases which don't affect a lot of people, but if you are one of the corner case users it's great to finally get it fixed.

As a side note, Service Pack 1 for Visual Studio 2005 has been in development for quite some time, the beta program closed by the end of October 2006, and Microsoft is saying the final version will be released any day now. The service pack will include all available hot fixes of course, but after that the download web site will be the main source for fixes until Service Pack 2 comes out (if there is even going to be one).

posted @ Tuesday, December 12, 2006 4:23 PM | Feedback (4)
Installing Subtext on IIS7, and SQL Server 2005

After going through some trouble to get my Subtext blog running on a Windows Vista installation with SQL Server 2005 I decided to write this how-to so that hopefully other people don't have to go through the same problems.

The instructions explain how to set up Subtext as a Virtual Directory. I also wrote two other articles related to Subtext installation: How to set up Subtext with its own web site instance (like I did with on IIS7, and How to compile and debug the Subtext source code on Vista using Visual Studio 2005.

This how-to is split into two parts: Part 1 gets straight to the point and explains step by step how to get everything set up correctly, Part 2 will give some troubleshooting advice if there are still problems. Most people search for a specific error message, so by including the error messages this post is more likely to be found by someone who needs help.

Part 1

0. Starting Point

As mentioned in the title the following instructions assume that you have an installation of Windows Vista. I used Windows Vista Ultimate Edition RC1 32 Bit which I got through the Customer Preview Program, but any edition, Beta, RC or RTM, and 32 or 64 bit should work with these instructions.

1. Installing IIS7

On a default Vista installation there is no IIS7, so you need to install the IIS7 components. However, since SQL Server 2005 requires IIS6 backward compatibility, we need to install some more features as described in the knowledge base article

2. Setting up the Database Server

I used Microsoft SQL Server 2005 Developer Edition, but again the instructions should work pretty much identical for any edition of SQL Server 2005, including SQL Server 2005 Express. Make sure to install SQL Server 2005 Service Pack 2 (note that Express has a separate download), which is needed to resolve authentication problems and other issues in Vista.

After installing SP2, the installer will inform you that even if your account has administrative privileges on Vista you don't automatically get administrative privileges on the SQL Server instance together with a link to add your current user to the SQL Server SysAdmin role. You should do that, otherwise you will have problems connecting to the server or creating the database.

Make sure to start the SQL Server Service after installing SP2, since you have to stop the service to run the update and it will not automatically start it again!

3. Preparing Subtext

After obtaining the latest binaries from the Subtext project web site on SourceForge you should unzip them to a location of your choice. I used version 1.9.2 for these instructions and unzipped the binaries into the default wwwroot folder created by the IIS7 installation.

4. Setting up the Virtual Directory

Open up the IIS Manager from Administrative Tools and expand Web Sites and Default Web Site. If you copied the Subtext binaries into the wwwroot folder, you should see the SubText- (or whatever your version is) directory now. Right-click on it and pick Convert to Application (which is basically the same as Add Application only that it prefills the values for you). The most important thing is that you change the Application pool to Classic .Net AppPool, otherwise you will have problems with the handlers and other things.

5. Creating the Database

Start up SQL Server Management Studio and connect to your local database server. Should you have failed to add your account to the SysAdmin role after installing SP2 or should the connection fail, make sure that the SQL Server Service is running and then start Management Studio using the "Run as Administrator" option from the right-click context menu. The connection to the server should now work. Then add your account to the Security -> Logins section and give yourself the SysAdmin role. Then you won't need to use elevated access rights anymore to connect to the server.

Create a new database with the name of your choice. For simplicity reasons I picked the default name SubtextData_1.9, but you can use any name. Make sure to edit the subtextData connection string in the Web.config file if you change the database name.

Now in the Security -> Logins section add a new login for the NETWORK AUTHORITY\NETWORK SERVICE user. Just like on Windows Server 2003 on Vista the NETWORK SERVICE user replaces the ASPNET user that you usually find on Windows XP systems for executing ASP.NET applications. Under User Mapping, check the Map checkbox for your Subtext database and give the account db_owner privileges. You will need that to set up the database.

6. Start Subtext installation Wizard

Open your favorite browser and navigate to the web address you used when you set up the Virtual Directory. If everything worked fine, you should see the Subtext welcome screen which will take you through the rest of the installation process.

Part 2

Problem: When installing SQL Server 2005 the following messages appears: "This program has known compatibility issues" and "After SQL Server Setup completes, you must apply SQL Server 2005 Service Pack 2 (SP2) or a later service pack before you run SQL Server 2005 on this version of Windows."
Solution: Continue and install SQL Server 2005 SP2 afterwards.

Problem: You receive this warning message for the IIS Feature Requirement on the System Configuration Check page of the SQL Server 2005 Setup program: "Microsoft Internet Information Services (IIS) is either not installed or is disabled. IIS is required by some SQL Server features. Without IIS, some SQL Server features will not be available for installation. To install all SQL Server features, install IIS from Add or Remove Programs in Control Panel or enable the IIS service through the Control Panel if it is already installed, and then run SQL Server Setup again. For a list of features that depend on IIS, see Features Supported by Editions of SQL Server in Books Online."
Solution: Install the necessary IIS7 components according to this Microsoft knowledge base article.

Problem: You receive the following message when navigating to your Subtext web address: "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
Solution: Make sure the SQL Server Service is running. After installing SQL Server 2005 SP2 the service is not automatically started again!

Problem: You receive the following message when navigating to your Subtext web address: "Subtext cannot connect to your backend database. Seems to be a problem with the login."
Solution: Make sure your connecting string points to the right database and that the database exists. The Subtext installation process will create database tables, but not the database itself. If the database exists, make sure the NETWORK AUTHORITY\NETWORK SERVICE user has dbowner rights on the database.

Problem: When running SQL Server Management Studio and trying to connect to your local database server, you get the following message: "Cannot connect to <machinename>. Additional information: Login failed for user '<machinename>\<username>'. (Microsoft SQL Server, Error: 18456)"
Solution: Even if your user has administrative rights in Vista, you don't automatically have them in SQL Server. Start Management Studio using the "Run as Administrator" option from the right-click context menu and connect to the server then. Then add your account to the Security -> Logins section and give yourself the SysAdmin role. Then you won't need to use elevated access rights anymore.

posted @ Monday, December 11, 2006 5:38 PM | Feedback (48)
Welcome! This is the blog of a .NET software development enthusiast living in Silicon Valey, California, USA. The opinions posted here are my own and in no way represent the opinions of my employer or anybody else.