DapperLib / Dapper

Dapper - a simple object mapper for .Net
https://www.learndapper.com/
Other
17.49k stars 3.67k forks source link

Unable to find Dapper.dll in linux machine. #2076

Open RanjiniRao14 opened 5 months ago

RanjiniRao14 commented 5 months ago

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!

mgravell commented 5 months ago

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.

RanjiniRao14 commented 5 months ago

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

RanjiniRao14 commented 5 months ago

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

RanjiniRao14 commented 5 months ago
dapper
mgravell commented 5 months ago

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.

RanjiniRao14 commented 5 months ago

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.

RanjiniRao14 commented 5 months ago
RanjiniRao14 commented 5 months ago

RanjiniRao14 commented 5 months ago
dapper1