UWP : Get Code coverage in an UWP application

Ramesh Krishnamurthy 6 Reputation points
2021-05-28T10:41:05.42+00:00

Hi, We are working on a UWP application. The application works just fine. We have included a unit test app (universal windows) and have written few testcases. The testcases are executed successfully, but we are unable to view the code coverage details. In the code coverage tab, we see the below error

Empty results generated: No binaries were instrumented. Make sure the tests ran, required binaries were loaded, had matching symbol files, and were not excluded through custom settings. For more information see https://go.microsoft.com/fwlink/?LinkID=253731

Searching the internet, I have seen links stating that the code coverage is not supported for UWP applications, is that true? If that's not true, then can someone help us please.

Developer technologies | Universal Windows Platform (UWP)
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Nico Zhu (Shanghai Wicresoft Co,.Ltd.) 12,871 Reputation points
    2021-05-31T01:42:00.687+00:00

    Hello, Welcome to Micorosoft Q&A,

    Unfortunately, there is no code coverage support yet for UWP apps. there is a workaround could be to change the UWP Class Libary to a .NET Standard Libary. Then change the UWP test project to the .NET Core variant. Running the code coverage via test explorer you will get the result.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.