.net core projects code coverage visual studio 2017

前端 未结 6 2074
一整个雨季
一整个雨季 2021-02-01 05:15

I am using Visual Studio Enterprise 2017 to develop my .net core projects.

My solution also has some unit test projects and I want to view my current Code coverage.

6条回答
  •  忘掉有多难
    2021-02-01 05:57

    JDC's answer helped me to include my actual projects but I could not get rid of the test projects in the coverage report. I managed it by adding a "CodeCoverage.runsettings" in my XUnit test project with the following content:

    
    
    
      
        
          
            
              
                
                  
                    .*\.Tests.dll$
                    
                  
                
              
            
          
        
      
    
    

    The important part here is to exclude the test project in the ModulePaths section.

提交回复
热议问题