title: Visual Studio 2015 "Analyze Code Coverage for All Tests" returns Empty Results Generated in some projects
body: <p>We have a very large source tree with many solutions/projects. We're attempting to improve our unit test coverage and putting together a CI environment (TFS). However, <strong><em>some</em></strong> of our projects will not generate code coverage when using VS 2015's "Analyze Code Coverage for All Tests". We simply get the "Empty results generated: No binaries were instrumented." message.</p>
  
  <p>This is easily remedied on a development machine by selecting all the tests in Test Explorer, right clicking, and then selecting "Analyze Code Coverage for Selected Tests". Unfortunately, this does nothing to fix the issue in our CI environment.</p>
  
  <p>In both cases the unit tests are run and I can see the pass/fail results.</p>
  
  <p>I've not been able to find any rhyme or reason as to why this happens in some project and not others. We do have a runsettings file to prevent calculating coverage for the test assemblies, however, excluding it only causes the test assemblies to be included in the coverage. Coverage for the code under test is still missing.</p>
  
  <p>Presumably there is a difference in how the underlying commands are run. Is there a reason why code coverage would exist under one and not the other? How can I fix my projects to make sure the coverage is calculated properly when running on the TFS server or using the "Analyze Code Coverage for All Tests" from the VS2015 interface?</p>
  
  <p><strong>Additional Notes:</strong></p>
  
  <ul>
  <li>Projects under test are all .NET 4.0 Class Libraries. There is some WinForms code in these projects, Forms are being excluded from coverage though.</li>
  <li>Test projects were created using the Test Project template.</li>
  </ul>
  
  <p>I can replicate the visual studio behavior on my projects using the command line.</p>
  
  <p>Does not provide coverage:</p>
  
  <pre><code>vstest.console.exe /EnableCodeCoverage "TestAssembly.dll"
  </code></pre>
  
  <p>Does provide coverage:</p>
  
  <pre><code>vstest.console.exe /EnableCodeCoverage /Tests: Test1 Test2 Test3 ... TestN "TestAssembly.dll"
  </code></pre>
  
  <p><strong>Additional Notes 2</strong>
  I ran </p>
  
  <pre><code> vstest.console.exe /EnableCodeCoverage "TestAssembly.dll"
  </code></pre>
  
  <p>All unit tests are run and pass as expected.</p>
  
  <p>Afterwards I ran the CodeCoverage analyze suggested at the end of <a href="https://blogs.msdn.microsoft.com/allendm/2012/06/05/troubleshooting-missing-data-in-code-coverage-results/" rel="nofollow">this blog</a>.</p>
  
  <pre><code> CodeCoverage.exe analyze /include_skipped_modules my.coverage &gt; analysis.xml
  </code></pre>
  
  <p>"AssemblyUnderTest.dll" does not appear in either the modules section or the skipped_modules section. I know "AssemblyUnderTest.dll" is being run because I can debug the test and break into the code for that assembly and as mentioned the tests ran and passed during this test run. Other assemblies referenced by the code are present in the skipped_modules section with reason "no_symbols" - this is expected.</p>