Is there any way to get code coverage numbers from Silverlight? Up until now it has been impossible. I was hoping with the new Visual Studio 2010 Service Pack or Silverlight 5 coming out that there might be a way.
Asked
Active
Viewed 1,067 times
5
-
I thought Silverlight was just a UI specification and set of libraries usable with .NET programs, but I'm ignorant. What exactly do you want coverage for, that you can't get? (The "Silverlight" UI spec? The manually written .NET code? Something else?) – Ira Baxter Apr 25 '11 at 19:56
-
... *really* interested in what you can't get and why think you can't get it. – Ira Baxter Apr 27 '11 at 03:08
-
Programs like ncover and nunit cannot get information based on the way the silverlight libraries are designed. Something about a sandbox – Xander Apr 28 '11 at 17:25
-
Is it that the silverlight code runs in a sandbox on the client side? Presumably it can communicate with the server code; in that case, one might be able to get the coverage data out of the sandbox and sent back to the server by the client-side custom code. – Ira Baxter Apr 28 '11 at 20:54
-
... If you can answer the question in detail about why you can't get the coverage data out (where's the sandbox? It can't be completely opaque) I might have an answer. – Ira Baxter Apr 29 '11 at 23:25
1 Answers
2
Jeff Wilcox outlines how to get Code Coverage from the Silverlight Unit Test Framework on his blog at http://www.jeff.wilcox.name/2009/11/november-walkthrough/

bendewey
- 39,709
- 13
- 100
- 125
-
I know it has issues (namely Win7 and 64bit), but I'm not aware of any announcements about it getting phased out. Do you have a link? – bendewey Apr 26 '11 at 18:58
-
By phased out I should have said they stopped working on it and it broke with the next release that came out after november – Xander Apr 27 '11 at 18:25
-
Yes, The creator Jeff Wilcox has been deep in to Windows Phone development so no updates have been made in a while. – bendewey Apr 27 '11 at 20:13
-
2FYI, I [recently got a reply from Jeff on his blog](http://www.jeff.wilcox.name/2011/06/updated-ut-mango-bits/) saying "We're not actively investing in test" so don't expect any update in this area for a while. – Richard Szalay Jul 08 '11 at 13:05