Dapper icon indicating copy to clipboard operation
Dapper copied to clipboard

Unable to find Dapper.dll in linux machine.

Open RanjiniRao14 opened this issue 1 year ago • 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!

RanjiniRao14 avatar Apr 23 '24 16:04 RanjiniRao14

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.

mgravell avatar Apr 23 '24 17:04 mgravell

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

RanjiniRao14 avatar Apr 24 '24 12:04 RanjiniRao14

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

RanjiniRao14 avatar Apr 24 '24 12:04 RanjiniRao14

dapper

RanjiniRao14 avatar Apr 24 '24 12:04 RanjiniRao14

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.

mgravell avatar Apr 24 '24 12:04 mgravell

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. <PackageReference Include="Dapper" Version="2.1.35" />

RanjiniRao14 avatar Apr 24 '24 13:04 RanjiniRao14

RanjiniRao14 avatar Apr 24 '24 13:04 RanjiniRao14

<PackageReference Include="Dapper" Version="2.1.35" />

RanjiniRao14 avatar Apr 24 '24 13:04 RanjiniRao14

dapper1

RanjiniRao14 avatar Apr 24 '24 13:04 RanjiniRao14