How to get code coverage when testing Silverlight
silverlight
Solution
Unfortunately, due to the transparent security model (i.e. all applications sandboxed) in the Silverlight runtime, this is not an easy task. Traditional .NET code coverage instrumentation modifies the underlying assembly, inserting P/Invoke calls to coverage collection tools.
As a result, tools like the Visual Studio 2008 code coverage instrumentation tool do not work with Silverlight.
To accomplish this in Silverlight, you would need to design a custom instrumentation program plus a way to collect and report that data.
On the Silverlight team we've developed a partial solution that may enable this for some people, but it is not ready for release. Look for it someday in the Silverlight Toolkit, possibly.
Sorry that I don't know an answer for you today.
Problem
I'm looking for code coverage solution which works with silverligt. It must also work with msbuild because we run all the other unit tests automatically in the build server. Integration with Visual Studio and/or resharper is a plus and I have nothing against easy setup or a pointer to a tutorial. I don't usually modify the build files and unfortunately I don't have time to learn msbuild at the moment.