Missing dependancy on linux
I tried running my dotnet core application on Ubuntu but I get this error:
admin@ns532585:~/starlegacywebsite$ dotnet starlegacy.net.dll Error: An assembly specified in the application dependencies manifest (starlegacy.net.deps.json) was not found: package: 'Antlr3.Runtime', version: '3.5.1' path: 'lib/netstandard1.1/Antlr3.Runtime.dll'
The Antlr3.Runtime seems to exist in the publish folder. If I try running it in the publish folder, I get this:
---> NHibernate.HibernateException: Could not create the driver from NHibernate.Driver.SQLite20Driver, NHibernate, Version=5.1.0.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> NHibernate.HibernateException: The DbCommand and DbConnection implementation in the assembly System.Data.SQLite could not be found. Ensure that the assembly System.Data.SQLite is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use
But it works on my local testing
After some fiddling I get this: ---> NHibernate.HibernateException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: Unable to load DLL 'SQLite.Interop.dll': The specified module or one of its dependencies could not be found. the dll is in the same folder though...
in the past on .NET framework the SQLite.dll had to be on x86 or x64 subfolder, not sure if its the case anymore
I tried uploading SQLite.Interop.dll files to both x64, x86, publish/x64, and publish/x86. Sadly, none of them worked.
@Miclebrick Do not know if this will help you, but we use SQLite with dotnet core on Ubuntu. To be able to run on Linux we had to add these packages:
<PackageReference Include="Microsoft.Data.SQLite" Version="2.0.0" />
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="1.1.9" />
Note that there are newer releases, I just copied from our csproj. Works like a charm on Win, Mac, Linux (ARM as well)
Had to change it from 2.0.0 to 2.0.1 to get it to compile, but after that it worked perfectly fine locally. Going to test it remotely... (Hard to test it remotely when it refuses to upload faster than 1 MB/s)
@uffebjorklund That didn't work... what nuget package do you use for SQLite? Maybe whichever one you are using would work better. I have System.Data.SQLite.Core.
Oh, I'm stupid.... package references ARE nuget packets
To get it to use Microsoft.Data.SQLite instead of System.Data.SQLite I had to use this: https://github.com/milestonetg/nhibernate-sqlite
That worked! Thanks for your help.