views:

409

answers:

2

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.

+1  A: 

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)

smbarbour
I had previously tried assigning a MIME type in IIS but it didn't work. I wasn't aware of application/x-test, so I just tried that and it didn't work either.
Wayne
+1  A: 

Have you tried changing the file association for .xml to Visual Studio instead of IE? I'm using Win7 and IE8 and I can set the associations here: Internet Options > Programs > Set Programs > Default Programs\Set Associations

DannyLane