DapperLib/Dapper

Unable to find Dapper.dll in linux machine.

RanjiniRao14 opened this issue · 9 comments

I have been using Dapper.dll (2.1.35) with system.data.odbc in windows with .net 8 ,however when I publish the same in linux box I'm seeing below issue when I run the application, though the dapper.dll is available in the bin directory where I'm executing.
Could not load file or assembly 'Dapper, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

Also tried changing to dapper.strongname , no luck with that as well.

Any help would be appreciated.

Thanks!

Not sure what I can say here; check your deployment - is the file there? We didn't write the build / publish system; from the perspective of a library author, we do need the library to be there, but how it gets there is the build system's problem.

yes the file exists with right version 2.1.35 but the error is pointing to 2.0.0.0 version.

I did publish the dlls from the windows and transferred manually to linux box

2.0.0.0 is the assembly version; that is correct - we pin that at 2.0.0.0 to prevent the problem of constantly having to update binding redirects (you can see this by looking at the assembly full name in NuGet package explorer, https://nuget.info/packages/Dapper/2.1.35)

Does manually adding the files make it work? Also, is your application using Dapper directly (i.e. does your exe have a <PackageReference> to Dapper), or is it transitive (i.e. your exe has a dependency of SomeOtherLib, and SomeOtherLib has a dependency on Dapper)? If transitive: try adding an explicit application-level package reference.

No manually adding files doesnt help either. Its not transitive dependency , its using directly with the connection object and I do have a reference in csproj file as shown below. This exe works perfectly fine in windows machine with .net 8 version.