How to get IE to open a file with its associated application


MSTest produces an XML file with a .trx extension containing test results.

If I have a .trx file on a machine without Visual Studio installed, I get prompted to "Use the Web Service…" or "Select from a list…", which is expected.
If I have a .trx file on my development machine and I open it, it opens in Visual Studio, which is expected.
If I click a link on a web page or in an email which gets a .trx file from my build server, it ALWAYS opens the XML in IE.

How do I configure IE (or IIS on the build server) to open the remote .trx file in Visual Studio, if it's installed, or prompt if it's not?

UPDATE: If I rename the .trx file on the server and give it various extensions (eg. .bmp, .msi, .txt, .zip), it still opens as XML in IE, so it's clearly going by the content of the file and not the declared MIME type.

Best Solution

It should be a matter of defining a MIME type for the file (i.e. "application/x-test") If I'm not mistaken, if the MIME type is not provided by the server, the client has to guess (and if it looks like a XML file, it gets treated like a XML file). I could be mistaken, but it is worth a try. You can access the MIME list for IIS from the MMC console snap-in for IIS by bringing up the properties of the server (not any of the configured sites)