title: How do I get code coverage colour-coding in Visual Studio based on real production use?
body: <p>I'm looking at a body of C# code, currently compiled and deployed to an Azure App Service, and used daily in production by hundreds of users.  The problem is, I'm not sure which lines of code are actually run in production.  There are many if/else blocks that may never be entered, or perhaps only very rarely.</p>
  <p>I could start by adding tracing statements throughout the code to gather usage data, but it would take too much time, and I would prefer to use existing tools.</p>
  <p>Ideally I would like to flick a switch to start gathering data, and be able to see the results inside Visual Studio.  It would be great to be able to see each line of code highlighted to indicate that it has indeed been run over the time period.  It would be even better to see how many times each line of code was run.</p>
  <p>Visual Studio CodeLens coupled with Application Insights provides the possiblity to see the number of HTTP requests that been serviced by a method in the past 24 hours, which is certainly better than nothing, but doesn't give me the line-by-line detail that I am looking for.
  <a href="https://docs.microsoft.com/en-us/azure/azure-monitor/app/visual-studio-codelens#requests-in-codelens" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/azure-monitor/app/visual-studio-codelens#requests-in-codelens</a></p>
  <p>Visual Studio (Enterprise edition) does provide some code coverage colouring, but only in the context of the execution of unit tests.  I'd like to analyze the data based on real production use.
  <a href="https://docs.microsoft.com/en-us/visualstudio/test/using-code-coverage-to-determine-how-much-code-is-being-tested" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/visualstudio/test/using-code-coverage-to-determine-how-much-code-is-being-tested</a></p>
  <p>Is there any tool that provides what I am looking for?</p>