.NET standard 2.0 project not able to load Dapper 1.50.5


I am just starting out with .NET standard. In a proof-of-concept project I'm trying to use Dapper as my ORM. In the .NET Standard 2.0 class library project, I added Dapper 1.50.5 Nuget package. However, the assembly isn't getting loaded at runtime. I get this error:

System.IO.FileNotFoundException   HResult=0x80070002
Message=Could not load file or assembly 'Dapper, Version=, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
The system cannot find the file specified.

Complete contents of my .csproj:

<Project Sdk="Microsoft.NET.Sdk">
    <PackageReference Include="Dapper" Version="1.50.5" />
    <PackageReference Include="Npgsql" Version="4.0.4" />
    <PackageReference Include="System.Data.SqlClient" Version="4.6.0" />
    <PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.3.0" />
    <PackageReference Include="System.Reflection.TypeExtensions" Version="4.5.1" />
    <PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.5.2" />
    <PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.1" />

So, you see I've installed the dependencies and dependencies of the dependencies.

What else should I do?

asked on Stack Overflow Dec 10, 2018 by KSK

1 Answer


The .NETStandard assembly was added as a reference to my WPF project. I needed to make changes in the .csproj of the WPF project.

The solution mentioned in https://github.com/dotnet/sdk/issues/901 fixes it.


  1. Edit your core .csproj file in notepad.
  2. Add the below two lines in each that you find in it.

  3. Clean and rebuild your solution.

Yes... I used Notepad.

answered on Stack Overflow Dec 11, 2018 by KSK

User contributions licensed under CC BY-SA 3.0