Поделиться через


WebMatrix 2 Beta - Integrating with IIS Developer Express

I want to take the time to describe how WebMatrix works with IIS Express, the development web server.   I hope that by the end of this article, users will better understand what IIS Express is capable of and how it works with WebMatrix.

What Is IIS Developer Express?

IIS Express is a lightweight, self-contained version of IIS optimized for developers. IIS Express makes it easy to use the most current version of IIS to develop and test websites. It has all the core capabilities of IIS 7 as well as additional features designed to ease website development including:

  • It doesn't run as a service or require administrator user rights to perform most tasks.
  • IIS Express works well with ASP.NET and PHP applications.
  • Multiple users of IIS Express can work independently on the same computer.

This comes from the IIS Express Overview page.  Basically, IIS Express is a standalone executable that works as a development  web server.  It only serves site content as long as the executable is running and generally only serves one specified site at a time. IIS on the other hand, runs as a system service and is generally started independently of other client applications.

What Happens When I Create a Site in WebMatrix?

Here is the basic workflow for site creation in WebMatrix.  This can help troubleshoot some errors and can possibly give some insight into how things are started.

  1. WebMatrix is started and the Start Page is show.  IIS Express has not started.

  2. A user will create a site either from a template or from the Application Gallery.  IIS Express still has not started.

  3. When the application installation completes, WebMatrix will launch IIS Express with the name of the recently installed site.  Users can check to see if IIS Express has correctly started by looking in the System Task Tray or by looking to see if a notification in WebMatrix has shown:
    Task Tray Verification:
    image

    WebMatrix Notification:
    image

  4. If IIS Express closes or crashes unexpectedly while WebMatrix has the site open, a notification will trigger in WebMatrix:
    IIS Express Stopped Notification:
    image

  5. If IIS Express for the site opened in WebMatrix is not started and the user clicks “Run” from the ribbon, WebMatrix will attempt to start IIS Express with the site parameter again.

  6. When WebMatrix is closed or the user closes the current site, IIS Express is also closed.

Troubleshooting IIS Developer Express

If you run into problems there are a number of locations that can give valuable information to help you figure out what went wrong.

  1. IIS Express Logs
    These logs can be found in \My Documents\IISExpress\logs\<SiteName> and \My Documents\IISExpress\TraceLogFiles\<SiteName>.
    The logs in the first directory are just the generic request transaction logs.  The Trace Log Files are the Failed Request Tracing logs that can be valuable in determining where a request is failing.  You can learn more about Failed Request Tracing here.
  2. Event Viewer  information
    Launch the Event Viewer by typing eventvwr from Run… and open up Windows Logs\Application.  Search for IIS Express or WebMatrix for crash information.
  3. Verifying that IIS Express can start
    From a command prompt, navigate to \Program Files<x86>\IISExpress\ and run IISExpress.exe.  If it successfully starts from a command prompt, but not from WebMatrix there might be additional problems.

Summary

Hopefully this has helped clarify how IIS Express and WebMatrix work together.  This little web server allows us to more accurately target live hosting providers so the development experience you have locally will be close to what the actual live site will be!

As always, if you have questions the forums are open and people are here to help!