March, 2008

Posts
  • CarlosAg Blog

    IIS 7.0 Manager for Windows XP, 2003 and Vista SP1

    • 7 Comments
    Technorati Tags:

    Last Wednesday we released the IIS Manager 7.0 client for Windows XP SP2, Windows Server 2003 and Windows Vista SP1.
    This is basically the IIS 7.0 Manager GUI that provides the ability to connect remotely to a Windows Server 2008 running the Web Management Service (WMSVC) to manage IIS 7.0 remotely.

    There are several key differences in this version of IIS Manager and its remote infrastructure:

    1) It allows for the first time users without administrative privileges to connect and manage their web sites and applications remotely

    2) It runs over SSL, no more DCOM, which makes this a firewall friendly feature easy to setup.

    3) Runs as a smart client, which means if a new feature is installed on the server it will automatically download the updated versions to the client machines.

    You can download it from:

    IIS.NET Web Site
    x86:
    http://www.iis.net/downloads/default.aspx?tabid=34&i=1626&g=6

    x64:
    http://www.iis.net/downloads/default.aspx?tabid=34&i=1633&g=6

    Microsoft.com/Downloads
    http://www.microsoft.com/downloads/details.aspx?FamilyID=32c54c37-7530-4fc0-bd20-177a3e5330b7&displaylang=en

    To learn more about remote management and how to install it:
    http://learn.iis.net/page.aspx/159/configuring-remote-administration-and-feature-delegation-in-iis-7/

    Now, to really show you what this is, I created a very simple demo that briefly shows the remote management capabilities over SSL. (Below there is a transcript in case my accent makes it difficult to understand my english :))

    Transcript:

    The purpose of this demonstration is to show you how easy it is to manage IIS 7.0 running in Windows Server 2008, from any machine that has Windows XP or Windows 2003 or Windows Vista by downloading the IIS Manager 7.0 that runs on all of those platforms.

    Now, today I am not going to focus on the details of how to configure it and how to setup the server to support remote management, but mainly just focus on the client aspect.

    On of the most interesting aspects of this remote management infrastructure is that it now uses an architecture that uses HTTPS to communicate to the server making this a nice firewall friendly remote management feature. Another key feature of this functionality is that it allows users without administrative privileges to connect and manage their Web Sites or their applications in a delegated way, where an administrator can restrict which options they can modify or not.

    OK, so to show you this I have here a Windows Server 2008 installed with IIS 7.0, and as you would expect I can manage it locally quite easily using IIS Manager, whether its adding a Web Site or managing the configuration from both IIS or ASP.NET I can do it here.

    This is all good, but now turns out I don’t want to connect locally but instead be able to remotely from my development machine connect to the server and still be able to do that and have the same experience as if I was locally logged on to the machine.

    To show this, I have here a Virtual PC image running a clean install of Windows XP SP2, the only thing it has installed additionally is the .NET Framework 2.0 which is the only requirement for the installation of IIS Manager 7.

    I have already downloaded the IIS Manager installer which takes only about 3MB of disk, that you can find at http://www. iis.net or http://Microsoft.com/downloads.

    Installing it is really simple and fast, just double click the icon and click next…

    Once installed I can now connect to any machine running Windows Server 2008 that has been configured to support remote management. To do that I just need to choose the option “Connect To Server/Site/Application” from the File Menu or the Start Page.

    Today, I will not drill down on the multiple differences between these connections, so for now I will just show how you can connect and manage the entire server by using a Windows Administrator account.

    Another interesting feature of the remote management platform is that if some new feature built on top of the UI Management extensibility API is installed on the server, when I connect again to the server, it will automatically prompt me if I want to get the new functionliaty and I can choose which features to install or not.

    To summarize, the IIS Manager 7 for Windows XP SP2, 2003 SP1 and Vista SP1 is available now, it only depends on the .NET FX 2.0 and it will allow you to connect to a remote server to manage it and have the same rich experience as if you were locally but using its new SSL remoting architecture.

  • CarlosAg Blog

    IIS Admin Pack Technical Preview 1 Released

    • 34 Comments

    NOTE: IIS Admin Pack Technical Preview 2 has been released: http://blogs.msdn.com/carlosag/archive/2008/05/13/IISAdminPackTechnicalPreview2Released.aspx

    I'm really exited to announce that today we released the Technical Preview of the IIS Admin Pack and it includes 7 new features for IIS Manager that will help you in a bunch of different scenarios.

    Download

    You can download the IIS 7.0 Admin Pack Technical Preview from (It requires less than 1MB):

    (x86) http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1646
    (x64) http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1647

    Documentation

    http://learn.iis.net/page.aspx/401/using-the-administration-pack/

    These UI modules include the following features:

    • Request Filtering UI - This UI exposes the configuration of the IIS runtime feature called Request Filtering.
    • Configuration Editor UI - This UI provides an advanced generic configuration editor entirely driven by our configuration schema. It includes things like Script Generation, Search functionality, advanced information such as locking and much more.
    • Database Manager UI - This UI allows you to manage SQL Server databases from within IIS Manager, including the ability to create tables, execute queries, add indexes, primary keys, query data, insert rows, delete rows, and much more.
    • IIS Reports UI - This extensible platform exposes a set of reports including some log parser based reports, displaying things like Top URL's, Hits per User, Page Performance, and many more.
    • FastCGI UI - This UI exposes the configuration for the FastCGI runtime feature.
    • ASP.NET Authorization UI - This UI allows you to configure the ASP.NET authorization settings.
    • ASP.NET Custom Errors UI - This UI allows you to configure the Custom errors functionality of ASP.NET

    Please, help us, we want to ask for your help on trying them and give us feedback of all these modules, do they work for you? what would you change? what would you add? What features are we missing?

    Some things to think about,

    Database Manager, what other database features are critical for you to build applications?

    IIS Reports set of reports, what reports would you find useful?, would you want to have Configuration based reports (such as summarizing the Sites and their configuration, which configuration)? More Security Reports (such as)?

    Configuration Editor, is it easy to use?, what concepts from configuration would you like to see?, etc

    Given that each individual feature above has a lot of interesting features that can easily be missed, or might be confusing, I will be blogging in the near feature talking about why we decided to build each feature, what makes them different from any other thing you've seen as well as how you can make the most out of each of them.

    NOTE: IIS Admin Pack Technical Preview 2 has been released: http://blogs.msdn.com/carlosag/archive/2008/05/13/IISAdminPackTechnicalPreview2Released.aspx

    Carlos

  • CarlosAg Blog

    IIS Admin Pack: Configuration Editor

    • 3 Comments

    Today I will be talking about one of the features included in the new IIS Admin Pack called Configuration Editor.

    Configuration Editor is an IIS Manager feature that will let you managed any configuration section available in your configuration system. Configuration Editor exposes several features from configuration that are not exposed anywhere else in IIS Manager, including:

    1. Schema Driven - Config Editor is entirely driven by the configuration schema (found in \windows\system32\inetsrv\config\schema\), this means that if you extend the configuration system creating your sections, they will be available for managing inside config editor, no need to build additional UI for them.
    2. Additional Information - Config Editor exposes more information such as the deepest place where the section is being used, or where a particular element in a collection is coming from (where is it inherited from?), etc.
    3. Script Generation - Allows you to make changes and it generates the code to automate those tasks, generating Managed Code (using Microsoft.Web.Administration), JavaScript (using AHADMIN) or Command Line (using AppCmd).
    4. Searching - Allows you to quickly perform scoped searches of the configuration system for all the sections and where they are being used, becoming a great way to get a bigger picture of the server as well as to prevent configuration locking violations and many other uses.
    5. Locking - Allows you to do advanced locking such as locking specific attributes so that they cannot be used in deeper locations, lock individual items in a collection or lock the entire section, etc.

    Please give us feedback on things you would like to see or change at the IIS Forums: http://forums.iis.net/1149.aspx

    OK, but rather than keep with more and more text, I will just show you a video on how it looks and all its features (for those of you who like text, there is a transcript below).

    Transcript:

    So I have here Windows Vista SP 1 with the IIS Admin Pack installed, in my machine I have very few applications installed but should be good to show some of the features on config editor. When entering Config Editor, first thing you will notice is that at the top you have a drop-down list that shows all the sections currently schematized and ready to be used in your system.

    Since this is sorted alphabetically, the first section that gets selected is AppSettings, for I can very easily switch between ASP.NET configuration sections, such as system.web/authentication, or the IIS configuration sections such as system.webServer/defaultDocument or the system.applicationHost/sites that contains all the sites configuration for IIS.

    As you can see the user interface displays the configuration elements and properties of the section that is selected, providing you an easy way to see every single configuration property available in the system.

    At the top you'll get a label specifying the deepest path where this section is being used relevant to your scope, so in this case its telling us that its been set in ApplicationHost.config. After that, all the elements and properties are shown in a Property Grid, that displaye elements as a collapsible set of properties. One of the interesting things is that we provide validation for the properties for example, when entering string characters in a numeric property type an error message will be displayed giving you the details of the expected types. Additionaly other benefits such as type editors, so that when editing a property of type boolean, you get the True/False drop-down, or when a property that is of type enumeration such as the LogFormat inside the SiteDefaults, you will get a drop-down list with only the list of options that are allowed for that enumeration. Same way, when editing a property of type flags such as the logExtFileFlags that contains the fields to include in the log file, you will get a multi-select drop-down list where you can select and de-select the different options. Also, you will notice that additional information is displayed as you select the different properties, giving you details of their data type as well as additional validations for those that have some, for example, the truncateSize property has specified that only a certain range is considered valid, if I type a value that is not within that range it will show this message giving me details of the problem.

    Making Changes

    Now, lets move to a simpler section so that we can show other features of the Configuration Editor. For example here in default documents, if I want to disable it I just change it to False and click Apply. As you would expect all the changes are applied and to see what changes this actually made in my system I'm going to show a Diff of the configuration that I have backed up and indeed the only change that happened in my configuration system is that it changed from true to false.

    Collection Editor

    As you will notice there is a collection in this section, all the collections are shown in an advanced collection editor that will let you see all the information of the items on it, including the ability to add, remove and clear the collection, as well as lock individual items on it. It additionally shows where each of the individual items is coming from making it easier to understand the distributed configuration.

    Another thing you will notice is that this collection editor shows some visual cues to help you deal with data, for example this little key here tells you that this property is the unique key of the collection item.

    So lets actually add a new one, for that I just need to click Add and fill the values, in this case, lets add Home.aspx as a new default document. After doing that, I can close dialog and click Apply. And lets take a look at what happened to my configuration. As you can see the new item was added. So as you can see its really easy to see and change configuration in collections.

    Script Generation

    Now, one of the interesting things that it also has is those changes that I just did, its great but sometimes I don’t want to apply them immediately but instead automate them so that I can apply them at a later time. For example, lets just change the attribute Enabled back to true, and rather than just applying the change as we did before, I want to generate the script cause probably I'm creating a provisioning script for my site and I want to include this as part of it, so just by clicking Generate Script I get this dialog that gives you the code for Managed Code using Microsoft.Web.Administration in C#, and as you can see its quite easy to read. It also gives you JavaScript code that uses a COM library that our configuration system ships called Microsoft.ApplicationHost, and just as the managed code version it just sets the value. It also gives you command line for it, so you don’t need to build code or scripts, you can just run the command line and to prove that, lets actually just run this command line. First lets show the diff again so that we see that its set to false. Now lets run the command line AppCmd which lives in Inetsrv directory. Now lets show the difference again, and as you can see it actually sets the value as expected. As you can see this will help you write scripts or code to manipulate IIS and ASP.NET settings without requiring additional knowledge.

    Locking

    Another interesting feature is locking, for example if I want to make sure that my default documents are always enabled and no one else can override them, I can go here and select the enabled attribute and click lock attribute which will prevent it from being changed in any other web.config file.

    Search Configuration

    Now, another interesting feature which is probably one of the most powerful features is the ability to search configuration so that you can see a high-level overview of the configuration system and all the web.config files on it. Just click Search Configuration. This shows me this dialog that shows me the root web.config that includes all the section that are being set on it, it also shows me applicationHost.config that includes again all the sections being used on it, as well as a location tag for a particular application that includes also some sections for it. you will notice that I also have a couple of applications that include web.config's in their folders, and sub-folders. where we can see how for example in this web.config it includes some

    one of the neat features is that you can actually click any of this nodes and it will immediately display the content of the section as well as where its coming from. For example if I click the web.config my entire web.config is displayed, if I click a specific section it only displays the content of the section. I can even click the locationPath that I'm interested and only get that particular one.

    Additionally you can easily search who is changing the authorization settings from asp.net and as easy as that you can see all the places in your server where the authorization settings are being set and quickly identify all the settings that are being used in your server. This feature is extremely useful because now, you can easily search for example default Document and make sure nobody is changing it and make sure no one else is violating the locking we just did.

    It also allows you to see the files in a flat view where it gives you all the different paths and files where each of them is coming from. You get the exact functionality, its just a different visual representation of the config.

    Schema-Driven

    Another interesting thing is that if you want to build your own sections and extend our configuration system, you can go to the schema folder and write your own configuration section, declare it using our schema notation, here I'm just defining a section named mySection, that includes an attribute called enabled of type bool and an attribute called message of type string and an attribute password of type string that should be encrypted.. Now, I just need to edit applicationHost.config to define the section so that config system knows we are going to consume it . Just by doing that, now I can go back to config editor and refresh the window, and my section is now available in the drop down, and as you would expect it displays all of the properties I defined, and I can just go ahead and set them, and I get all the locking functionality, I get all the script generation, I get all the UI validation.

    And if I apply, you will see that as expected the changes are done, the password attribute is encrypted, etc.

    So as you can see configuration editor is an extremely powerful feature that will be really useful for successfully managing the web.config's in your system.

  • CarlosAg Blog

    IIS 7.0 Admin Pack: Request Filtering

    • 12 Comments

    My last post talked about the Technical Preview release of the IIS 7.0 Admin Pack, and how it includes 7 new features that will help you manage your IIS 7.0.

    Today I was going to start writing about more details about each feature and Bill Staples just posted something (How to (un)block directories with IIS7 web.config) that almost seems that it was planned for me to introduce one of the features in the Admin Pack, namely Request Filtering UI.

    IIS 7.0 includes a feature called Request Filtering that provides additional capabilities to secure your web server, for example it will let you filter requests that are double escaped, or filter requests that are using certain HTTP Verbs, or even block requests to specific "folders", etc. I will not go into the details on this functionality, if you want to learn more about it you can see the Request Filtering articles over http://learn.iis.net

    In his blog Bill mentions how you can easily configure Request Filtering using any text editor, such as notepad, and edit the web.config manually. That was required since we did not ship UI within IIS Manager for it due to time constraints and other things. But now as part of the Admin Pack we are releasing UI for managing the Request Filtering settings.

    Following what Bill just showed in his blog, this is the way you would do it using the new UI instead.

    1) Install IIS Admin Pack (Technical Preview)

    2) Launch IIS Manager

    3) Drill down using the Tree View to the site or application you want to change the settings for.

    4)  Enter into the new feature called Request Filtering inside the IIS category

    5) Select the Hidden Segments and choose "Add Hidden Segment" from the Task List on the right

    6) Add the item

    As you would expect the outcome is exactly as Bill explained in his blog, just an entry within you web.config, something like:

        <system.webServer>
           
    <security>
               
    <requestFiltering>
                   
    <hiddenSegments>
                       
    <add segment="log" />
                    </
    hiddenSegments>
               
    </requestFiltering>
           
    </security>
       
    </system.webServer>

    So as you can see the Request Filtering UI will help you discover some of the nice security settings that IIS 7.0 has. The following images show some of the additional settings you can configure, such as Verbs, Headers, URL Sequences, URL Length, Quey String size, etc.

  • CarlosAg Blog

    Search your configuration sections in web.config files using IIS 7.0 API's

    • 1 Comments

    Background

    In IIS 7.0 we have the great functionality to allow you to configure the Web Server settings in a distributed way, including the IIS configuration along with the ASP.NET configuration in the web.config files by using Configuration Sections. For example, the following shows a web.config adding a default document (home.aspx) to a Web Application inside my Default Web Site:

    <configuration>
     
    <system.webServer>
       
    <defaultDocument>
         
    <add value="home.aspx" />
        </
    defaultDocument>
     
    </system.webServer>
     
    <system.web>
       
    <authentication mode="Forms" />
      </
    system.web>
    </configuration>

    Now, that is great but it does come with a price, specially for server administrators it means that now you need to deal with a distributed configuration environment where certain settings are applied at the server level and certain settings are applied along with the application or even folders.

    Another interesting challenge is that given the nature of distributed configuration, we've added the functionality to lock certain configuration sections so that they can only be set by a server administrator. Again this is good, however before the server administrator locks any section in order to prevent breaking applications they should search configuration and see if anyone is using that configuration section underneath.

    Searching Configuration

    The IIS 7.0 configuration system has a not so well-known feature that allows you to "query" the configuration system to get an overview of the configuration files in the system as well as the configuration sections that are used in each of them. This feature is implemented as a magical section called configPaths, that has the following schema:

      <sectionSchema name="configPaths">
       
    <collection addElement="searchResult">
         
    <attribute name="path" type="string" />
          <
    attribute name="locationPath" type="string" />
          <
    attribute name="status" type="uint" />
          <
    collection addElement="section">
           
    <attribute name="name" type="string" isUniqueKey="true" /> 
          </
    collection> 
       
    </collection>
     
    </sectionSchema>

    How to use it

    One thing that is pretty cool is that you can consume this section from all of our tools, including a command line (AppCmd.exe), a script (such as vbscript or javascript using Microsoft.ApplicationHost.AdminManager), or using Managed Code (Microsoft.Web.Administration) including the ability to use it under PowerShell. For this exercise we will only use Microsoft.Web.Administration,  but the concepts are exactly the same in the other tools.

    In its simplest form you can use the following function to display all the configuration files in your server as well as the sections included on them (just add a reference to Windows\System32\Inetsrv\Microsoft.Web.Administration.dll):

        /// <summary>
        /// Displays the list of configuration files as well as the 
        ///     sections being used in each file
        /// </summary>
        private static void DisplaySections() {
           
    using (ServerManager serverManager = new ServerManager()) {
               
    Configuration appHost = serverManager.GetApplicationHostConfiguration();
               
    ConfigurationSection configPaths = appHost.GetSection("configPaths");

               
    foreach (ConfigurationElement configPath in configPaths.GetCollection()) {
                   
    string path = (string)configPath["path"];
                   
    string locationPath = (string)configPath["locationPath"];

                   
    Console.WriteLine();

                   
    Console.WriteLine("Config Path:" + path);
                   
    if (!String.IsNullOrEmpty(locationPath)) {
                       
    Console.WriteLine("  <locationPath path=" + locationPath + "'>");
                   
    }

                   
    foreach (ConfigurationElement section in configPath.GetCollection()) {
                       
    Console.WriteLine("    " + section["name"]);
                   
    }
               
    }
           
    }
       
    }
    An example result of running this is:
    Config Path:MACHINE/WEBROOT/APPHOST
        system.applicationHost/applicationPools
        system.webServer/defaultDocument
        system.webServer/ImageCopyright
        system.applicationHost/sites
        system.webServer/security/authentication/windowsAuthentication
        system.webServer/tracing/traceProviderDefinitions
        ...
    
    Config Path:MACHINE/WEBROOT/APPHOST
      <locationPath="Default Web Site/BlogApp">
        system.webServer/security/authentication/windowsAuthentication
    
    Config Path:MACHINE/WEBROOT/APPHOST
      <locationPath path="Default Web Site/aspnet_client">
        system.webServer/directoryBrowse
        system.webServer/handlers
    
    Config Path:MACHINE/WEBROOT/APPHOST
      <locationPath path="Site2/aspnet_client">
        system.webServer/directoryBrowser
        system.webServer/handlers
        system.webServer/defaultDocument
    
    Config Path:MACHINE/WEBROOT/APPHOST
      <locationPath path="Default Web Site">
        system.webServer/security/authentication/anonymousAuthentication
        system.webServer/directoryBrowse
        system.webServer/security/authentication/windowsAuthentication
    
    Config Path:MACHINE/WEBROOT/APPHOST/Default Web Site
        appSettings
    ...

    This tells us that in ApplicationHost.config we have a lot of sections begin used including applicationPools and many more.

    Now, lets focus on the last two set of entries, the one with "MACHINE/WEBROOT/APPHOST" with locationPath set to "Default Web Site" tells us that anonymousAuthentication was used as well as windowAuthentication. The locationPath basically tells the configuration that even though this is set in ApplicationHost.config this configuration should only be applied to Default Web Site and its children. The next entry with path "MACHINE/WEBROOT/APPHOST/Default Web Site", basiclally tells you that in the Web.config inside the Default Web Site (in other words in c:\inetpub\wwwroot\web.config) the section appSettings is being used.

    Now, what is interesting is that this is walking the entire server to find configuration files and do a lot of processing, however if you already know that you only want to search within a Site, or a particular application, then you can scope it down by using the GetWebConfiguration() method instead and this will give you only the configuration sections that apply for that site or application. Note that this will also report the sections that are specifically set for that object inside ApplicationHost.config making it much more than just a "findstr" inside the site folder and their virtual directories.

        DisplaySectionsForSite("Default Web Site");

       
    private static void DisplaySectionsForSite(string siteName) {
           
    using (ServerManager serverManager = new ServerManager()) {
               
    Configuration appHost = serverManager.GetWebConfiguration(siteName);
               
    ConfigurationSection configPaths = appHost.GetSection("configPaths");

               
    foreach (ConfigurationElement configPath in configPaths.GetCollection()) {
                   
    string path = (string)configPath["path"];
                   
    string locationPath = (string)configPath["locationPath"];

                   
    Console.WriteLine();

                   
    Console.WriteLine("Config Path:" + path);
                   
    if (!String.IsNullOrEmpty(locationPath)) {
                       
    Console.WriteLine("  <locationPath path=" + locationPath + "'>");
                   
    }

                   
    foreach (ConfigurationElement section in configPath.GetCollection()) {
                       
    Console.WriteLine("    " + section["name"]);
                   
    }
               
    }
           
    }
       
    } 

    PowerShell

    Now, lets look at other examples, lets consider that we are a server administrator and I want to lock the defaultDocument section, but as a good citizen I first want to see if I would be breaking any application in my entire server if I do this. Just for fun lets do this using PowerShell instead, to test this just copy the entire code below and paste in inside an elevated PowerShell window.

    $sectionToLookFor = "*defaultdocument*"

    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Administration")
    $iis = new-object Microsoft.Web.Administration.ServerManager

    $configPaths = $iis.GetApplicationHostConfiguration().GetSection("configPaths").GetCollection()

    foreach($path in $configPaths.GetCollection()) {
     
    foreach($section in $path.GetCollection()) {
       
    if ($section.GetAttributeValue("name") -like $sectionToLookFor) {
         
    write ($path.GetAttributeValue("path") + " LocationPath:" + $path.GetAttributeValue("locationPath"))
         
    write ("    " + $section.GetAttributeValue("name"))
       
    }
     
    }
    }

    The result in my machine gives you something like follows:

    MACHINE/WEBROOT/APPHOST
        system.webServer/defaultDocument
    MACHINE/WEBROOT/APPHOST/Default Web Site/aspnet_client
        system.webServer/defaultDocument
    MACHINE/WEBROOT/APPHOST/Site2/aspnet_client
        system.webServer/defaultDocument

    This tells us that inside the c:\inetpub\wwwroot\aspnet_client\web.config file we are actually using that section so if we end up locking this in the server we would break that application.

    Summary

    The configPaths section is a very useful section that allows you to search configuration files and the configuration sections being used in each of them, making it an invaluable tool for scenarios like understanding the configuration usage as well as locking and many others.

  • CarlosAg Blog

    Windows Live Writer Plugin to insert Colorized Code

    • 3 Comments

    When I installed Windows Live Writer for the first time I was skeptical of having a different blog writer, so far I was very happy using Microsoft Word 2007 as my blog editor. However I decided to give it a try and see what I could get from it.

    Now, I can only tell you that I love it, the biggest reason is because it comes with a simple API that allows you to extend it and add functionality to it. This approach of exposing the platform really makes me feel I can do everything, and if I can't, then I can just extend it to do what I need.

    In my case every time I blog something that uses code, I always try to "colorize" it (personally find it easier to read when code is formatted using colors). That is the reason I wrote my original Code Colorizer application so that I could just paste the code in, and get the HTML that I would then tweak manually directly in the blog engine.

    Now that I'm using Windows Live Writer, I decided to test-drive the extensibility model they expose and wrote my Code Colorizer for Windows Live Writer so that I don't need to hand edit anything.

    The idea is that you just download the DLL into the Plugins (C:\Program Files\Windows Live\Writer\Plugins) directory, launch Live Writer and now, you will get a task "Insert Colorized Code..." that will show you a dialog where you can either type the code or just paste it and the right HTML will be inserted in your blog.

    This for the first time makes it really easy for me to insert formatted code without the need to tweak anything by hand.

    You can download it for free at: http://www.carlosag.net/Tools/WindowsLiveWriter/Default.aspx

    The following video uses Silverlight to show how this works (Click the image to start playing):

    The following image shows a snapshot of the tool in action:

Page 1 of 1 (6 items)