3
votes

I'd like to measure the coverage from UI integration tests, so I need to apply OpenCover to the running ASP.NET application, not the test execution. (I already got coverage for unit tests by running OpenCover on VSTest.Console.Exe.)

When I launch the app from Visual Studio 2013, it looks like it's running iisexpress.exe. How could I figure out what command line VS is running so I could pass the same command line to OpenCover?

1
IISExpress is quite easy to run - iis.net/learn/extensions/using-iis-express/…Shaun Wilde

1 Answers

4
votes

OK, I figured it out.

The right command line to use is iisexpress.exe /site:[sitename] where sitename matches whatever your web project is called in Visual Studio. Specifying just the path to the project will not provide the desired results.

And to get test coverage with OpenCover, you would run

OpenCover.console.exe -target:iisexpress.exe -targetargs:"/site:sitename" -register:user

assuming you're in the same directory as your web project build with the PDB files, otherwise you may need to use -targetdir argument to OpenCover