System.ComponentModel.Composition Example

I started playing with the .NET Framework 4.0 composition namespace (also known as MEF) and I want to share the most simple example I could write. The program prints out the providerName field, but the actual value is provided by the ExternalProvider class. The CompositionContainer class is able to wire the ExternalProvider.Name property and the…

2

Run MSTest.exe as a native 64-bit process.

If you need to run MS Test command line utility as a 64-bit process you need to do 2 things: Disclaimer: Be aware that this is not supported and it is under you own risk. 1. Backup the MSTest.exe file first and then remove the 32-bit flag by running the CorFlags.exe utility as:     CorFlags.exe…

4

Faster proxy detection for HttpWebRequest

Do a web request using System.Net classes, HttpWebRequest or WebClient. For example: new WebClient().DownloadFile("http://tinyurl.com/d5yy8a", @"C:\Temp\file.xml"); Or: HttpWebRequest.Create("http://tinyurl.com/d5yy8a").GetResponse(); If the first request takes more than 4 seconds and you think is too much time for your application, then the following information may interest you. The reason the first request takes more time is because it tries, by…

2

How to consume ETW events from C#

In my previous post I explained how to collect ETW events from URL Rewrite (or any other IIS provider) and then display those structured events in the Event Viewer. Now I want to show you how to collect ETW events using C#. The .NET Framework 3.5 provides a new namespace System.Diagnostics.Eventing.Reader where you can find…

16

How to display URL Rewrite ETW Events in the Event Viewer

IIS Failed Request Tracing is a powerful way to troubleshoot Web Requests, it provides an easy way to track each execution step for one specific request. URL Rewrite Module provides several events that can be tracked using Failed Request Tracing, here is an article that explains how: http://learn.iis.net/page.aspx/467/using-failed-request-tracing-to-trace-rewrite-rules/ IIS Modules have the ability to publish…

4