Monday, May 10, 2010

Enabling ASP.NET 2.0 in Vista RTM

Developing Web Applications on Windows Vista with Visual Studio 2005: Tip/Trick: Using IIS7 on Vista with VS 2005
Microsoft Windows Vista RC1 is now available to the public (view the press release), and many Visual Studio 2005 web developers are eager to start building ASP.NET 2.0 applications running under Internet Information Services 7.0, which is included with the Vista operating system. To build web apps under this environment, there are just a few steps you need to perform:



1. First, you need to install the IIS 7.0 and ASP.NET 2.0 Windows components, since they are not automatically installed by default. Because Visual Studio 2005 uses the IIS metabase APIs to create and configure applications in IIS, you must also install a metabase compatibility component for IIS 7.0. To do this, use the “Programs and Features” control panel in Vista, following the steps below.
To install IIS 7.0 and ASP.NET 2.0 on Windows Vista

1. In Windows Vista, open Control Panel and then click Programs and Features.

In the right pane, click Turn Windows features on or off.
The Windows Features dialog box opens.




2. Select the Internet Information Services check box.

3. Double-click (or expand) Web Management Tools, double-click IIS 6 Management Compatibility, and then select the IIS 6 Metabase and IIS 6 Configuration Compatibility check box.

4. Double-click (or expand) World Wide Web Services, double-click Application Development Features, and then select the ASP.NET check box.

Note The related options that are necessary for Web application development will automatically be selected.

5. Click OK to start the ASP.NET installation process.

Second, you must run Visual Studio 2005 in the context of an administrator account before you can develop web applications on Windows Vista. By default, Windows runs applications in a limited-privilege user account even when you are logged on to the computer as an administrator. To explicitly run Visual Studio as administrator, follow the steps below.



To run Visual Studio with administrative privileges in Windows Vista

1. In Windows Vista, click Start, click All Programs, and then locate Visual Studio.

2. Right-click Microsoft Visual Studio 2005, and then click Run as administrator.



One more note: If you happen to use SQL Server Express for database development, you'll also need to download and install SQL Server Express SP1, which contains updates required to run on Vista.

Enjoy developing on Vista and be sure to let us know what you think of IIS 7.0!



A few people have pinged me over the last week asking about how to use VS 2005 with an IIS 7.0 web-site on Windows Vista. Specifically, they've run into an issue where they see a dialog message asking them to install the FrontPage Server Extensions, or they get a "You must be a member of the administrators group" message when they try to connect (see dialog below):
quickly summarize you need to follow the below two steps to enable it:

1) You need to make sure that you have the the optional "IIS 6 Management Compatibility" option installed within IIS7. This installs an API for the new configuration system that is compatible with the old Metabase APIs (which is what VS 2005 uses). You can select this using the "Turn Windows Features on or Off" option in the Vista Control Panel:

2) You need to make sure you launch VS 2005 with "elevated" privledges so that you have admin privledges to connect to IIS (this is needed to debug a service, as well as create sites and/or change bindings that impact the entire machine). You can do this by right-clicking on the VS icon and select the "Run as Administrator" option when launching VS:


Note that this is needed even if your user is already in the administrators group if you have UAC enabled (which is on by default with Vista). If you disable UAC (which you can also do via the control panel), then this second step isn't required. Running VS 2005 with "elevated" privledges won't be required if you use the built-in VS 2005 Web-Server (since it has reduced privledges already). It is only required when connecting and running/debugging with IIS locally.

We'll be updating Visual Studio 2005 to have more accurate error messages to help guide you to the above steps more naturally in the future. Until then, just use the above steps and you are good to go.


In this post, I will share how I overcome this problem by manually performing extra steps to make ASP.NET works in Visual Studio 2005. Before I start, you should understand that Vista RTM installation comes with total security. That means all web development features are locked down.

The following steps will unlock the web development features so you can get back to your web development:

Open “Services”. Now you can do this very easy by typing Services in the search textbox located at the bottom of start menu panel.
Find “Windows Process Activation Service”. Change its Startup Type to Automatic, and “Start” the service.
Next, find “World Wide Publishing Service”. Notice that you can not directly start this service because it is in “disabled” state. The trick is by changing the Startup Type to Automatic first, then you can start this service.
Next, open “Command Prompt”. Again you can do this quickly by typing “cmd” in the search textbox.
Run this command “aspnet_regiis -i” inside ASP.NET 2.0 Framework folder. This will re-register ASP.NET 2.0 handlers and mapping to all existing web applications.
Finally, run this command “net start w3svc”. Your web server should be started perfectly at this time.
Try to open one of your HTTP project in Visual Studio 2005 and run one of your webform. Here you go.


No comments:

Post a Comment