title: Microsoft.Bcl.AsyncInterfaces error (in CSVHelper method) when running the application installed by Visual Studio Setup project
body: <p>I have a WPF application that reads a CSV file using <code>CSVHelper</code> which I installed using <code>NuGet</code>. Here's the project, system, etc version info.</p>
  
  <blockquote>
    <p>Microsoft Windows 7 Professional Version  6.1.7601 Service Pack 1 Build
    7601</p>
    
    <p>Microsoft Visual Studio Community 2019 Version 16.4.5</p>
    
    <p>NuGet Package Manager   5.4.0</p>
    
    <p>WPF Project Target Framework: .NET Framework 4.7.2</p>
    
    <p>CSVHelper Version: 15.0.5</p>
  </blockquote>
  
  <p>CSV reader method is straightforward; read a file and put it in a list. Nothing fancy. I'll link the entire project at the bottom so you can download and try it out if you want.</p>
  
  <p>When I run the executable made in either <code>Release</code> or <code>Debug</code> builds, they work fine. They read the file, put contents in a list, and display on a <code>DataGrid</code> just fine. As a next step, I created a standard <code>Visual Studio Setup</code> project, and created an <code>msi</code> installer, which I used to install the app in my PC.</p>
  
  <p>When I run that executable (which is in my Program Files directory), however, the application throws an exception. Here's the exception message and Stack Trace.</p>
  
  <pre><code>Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. Reference assemblies should not be loaded for execution.  They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)
     at ReadCSVTest.MainWindow.ReadPeopleList(String path, List`1&amp; people, String&amp; msg)
     at ReadCSVTest.MainWindow..ctor()
  </code></pre>
  
  <p>Since the error says couldn't load the assembly <code>Microsoft.Bcl.AsyncInterfaces</code>, I added that from NuGet and ran everything again, and I still get the error. What's the problem here? What does it mean that <code>Reference assemblies should not be loaded for execution.  They can only be loaded in the Reflection-only loader context.</code>? And why do I only get this exception when I run the executable installed by the Setup project?</p>
  
  <p>Please download the entire project from <a href="https://github.com/sachintha81/PublicDownloads/blob/master/ReadCSVTest.zip" rel="nofollow noreferrer">HERE</a>.</p>