Week roundup

Last week recap and links:
Image courtesy of kanate / FreeDigitalPhotos.net

Image courtesy of kanate / FreeDigitalPhotos.net

What are your best reads this week? Leave them in the comments below.

Posted in Uncategorized | Tagged , , | Leave a comment

Repro metabase COM Exceptions

Our project uses IIS to host custom web applications. We received an issue: when creating a web application some COM Exception is logged.

To reproduce the issue we created a console application that connects to IIS metabase. The Find method was the source for the COM Exception, so we tried some scenario’s and logged the outcome. See the listing below.

var directory = new System.DirectoryServices.DirectoryEntry(
   "IIS://localhost/W3SVC/1");
try {
    var child = directory.Children.Find("Root", "IISWebVirtualDir");
    Console.WriteLine("Found directory {0}", child.Name);
} 
catch(System.IO.DirectoryNotFoundException) {
    // child is not found (even when schemaclassname is wrong)
    Console.WriteLine("Directory not found");
}
catch(System.Runtime.InteropServices.COMException ex) {
    // 0x80070003: system cannot find the path (use connection 
    //             IIS://localhost/W3SVC/13)
    // 0x80070005: access denied (run without Administrative right)
    // 0x800706BE: metabase corrupt (edit applicationhost.config)
    // 0x80005000: unknown error (use iis:// instead of IIS://  
    //             or add / at end of connectionstring)
    // 0x80005008: Find with IIsWebDirectory as schemaclassname 
    //             (wrong argument) and item is present
    Console.WriteLine("COM Exception {0}: {1}", 
            ex.ErrorCode.ToString("X"), ex.ToString());
}
catch(Exception ex) {
    Console.WriteLine("Something is wrong: {0}", ex.Message);
}

Together with our metabase corruption repro we get a list of errorcodes. This list goes into our Knowledge Base with an advised next step.

Image courtesy of ratch0013 / FreeDigitalPhotos.net
Image courtesy of ratch0013 / FreeDigitalPhotos.net

Posted in Development | Tagged , , | Leave a comment

Customize Office365 installation

We’re using Office 365 to support Choose Your Own Device. On my Windows laptop I’ve installed it. There is no option to remove unneeded programs after the installation. To save some room (like on a SSD) you can configure which programs to install.

office365

First you’ll need to get the Office Deployment Tool for Click-to-run (download page) or search for it on microsoft.com downloads.

Run the tool with /extract option. This will put the setup.exe and configuration.xml files on disk.

officedeploymenttool /extract:d:\Personal\Downloads\office

Now edit the configuration.xml to exclude applications you don’t want. Microsoft has a technet article about the options. Below is mine

<Configuration>
   <Add OfficeClientEdition="32">
      <Product ID="O365ProPlusRetail">
         <Language ID="nl-nl"/>
         <ExcludeApp ID="Publisher"/>
         <ExcludeApp ID="InfoPath"/>
         <ExcludeApp ID="Access"/>
         <ExcludeApp ID="OneNote"/>
         <ExcludeApp ID="OneDrive"/>
      </Product>
   </Add>
   <Updates Enabled="TRUE"/>
   <Display AcceptEULA="TRUE" Level"None"/>
   <Logging Path="d:\Personal\Downloads\office"/>
</Configuration>

Only two more commands and you’re done

setup /download configuration.xml
setup /configure configuration.xml

The first command will download the installation files. The second will do the installation. Both take in account only the programs you want to have. You might also want to do a (Windows) update.

No more unwanted programs = extra free space on your drive. And we all love free space!

Posted in Tooling | Tagged , | Leave a comment

Week roundup

Last week recap and links:
Image courtesy of kanate / FreeDigitalPhotos.net

Image courtesy of kanate / FreeDigitalPhotos.net

What are your best reads this week? Leave them in the comments below.

Posted in Uncategorized | Tagged , , , | Leave a comment

Repro metabase corruption

Our project uses IIS to host custom web applications. We received an issue where sometimes the application pool wouldn’t start because of an corrupt configuration.

metabase_corruption

To reproduce the issue we run the software to install the web application. This way the application pool is created and available in the metabase for editing.

After completion stop the application pool, then open “C:\Windows\System32\inetsrv\config\applicationHost.config” and locate the applicationPool.

<!-- .... -->
<system.applicationHost>
   <applicationPools>
      <add name="ReproAppPool" autoStart="false" managedRuntimeVersion="v4.0" />
<!-- .... -->

Change an attribute so it is not accepted by IIS (eg <add name=”ReproAppPool” managedSomething=”v4.0″ />) This will cause the metabase to throw the exception.

Now undo the change to the applicationHost.config. Other applications will stop throwing the HTTP500, but the ReproAppPool will not start by itself and that application keeps throwing HTTP503.

With this repro we can now fix the issue by adding some exception handling.

Posted in Development | Tagged , | 1 Comment