Dot Net Core portable app running on Windows but not on Linux

0

I'm developing a dotnet core 3.1 console app using C# on windows which should generate a dll to be used on a Ubuntu machine.

From a third-party I've got 3 DLLs (ext.dll, ext64.dll, extNet.dll) which are needed for communicating with another device in the same network. To program the app I only need extNet.dll, the other two must be however present as extNet.dll is internally requiring them.

Using Visual Studio 2019 Community, when I try to add the 3 ext*.dll files to the "Dependencies > Assemblies" of my project, ext.dll and ext64.dll will fail with the error

"The reference is invalid or unsupported"

Only the extNet.dll can be added without problems.

I can program my app, and when trying to run, it will give the error:

"System.DllNotFoundException: Unable to load DLL 'ext64.dll' or one of its dependencies: The specified module was not found. (0x8007007E)"

When I simply copy both files (ext.dll, ext64.dll) to my Project/bin/Debug/netcoreapp3.1/ folder and try to run again, the app will work with no problems on my windows machine.

I then copied all the contents of Project/bin/Debug/netcoreapp3.1/ (including ext.dll and ext64.dll) to my Ubuntu machine, and try to run... but on Linux it will continue failing with

"System.DllNotFoundException: Unable to load DLL 'ext64.dll' or one of its dependencies: The specified module was not found. (0x8007007E)"

On Ubuntu I have dotnet version 3.1.102, with following runtimes installed:

  • Microsoft.AspNetCore.App 3.1.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  • Microsoft.NETCore.App 3.1.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

On Windows, I have dotnet version 3.1.102, with following runtimes installed:

  • Microsoft.AspNetCore.All 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  • Microsoft.AspNetCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  • Microsoft.AspNetCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  • Microsoft.AspNetCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  • Microsoft.NETCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  • Microsoft.NETCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  • Microsoft.NETCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  • Microsoft.WindowsDesktop.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  • Microsoft.WindowsDesktop.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

I've tried to manually add the References on my *.csproj file, but that does not works either:

<Project Sdk="Microsoft.NET.Sdk">   
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFrameworks>netcoreapp3.1</TargetFrameworks>
  </PropertyGroup>   
  <ItemGroup>
    <Reference Include="extNet">
      <HintPath>..\dlls\extNet.dll</HintPath>
    </Reference>
    <Reference Include="ext">
      <HintPath>..\dlls\ext.dll</HintPath>
    </Reference>
    <Reference Include="ext64">
      <HintPath>..\dlls\ext64.dll</HintPath>
    </Reference>
  </ItemGroup>   
</Project>

Questions..

  1. How can I add the ext.dll and ext64.dll to the regular Assemblies of my project? Why these two files fail and extNet.dll works?
  2. How come in Windows, it is enough to copy the dll's to the same folder to be able to run the app? While in Linux that does not works?
  3. How can I make the app to work also on Linux?
c#
.net-core
dll
asked on Stack Overflow Oct 8, 2020 by Ñhosko

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0