How to install libdl.so on linux contianers? - asp.net

I am using Visual Studio .net Core with Linux Docker Contianers.
I am attempting to use dlopen, which is part of the libdl.so library.
I get:
DllNotFoundException
.
Unable to load shared library libdl.so or one of its dependencies
I was going to download the .so somewhere and put it in the execution path. Unfortunately I could not find a straight copy of libdl.so.
Is there some way to include this library? Maybe a Nuget package
Thanks

Related

Brand new Monodevelop installation can't restore packages

I'm trying to use MonoDevelop in order to work with .NET Core. In a brand new Linux Mint 20.1 machine, I installed MonoDevelop 7.8.4, and opened a project that I'm working on, and the IDE complained imediatelly:
Getting restore information for solution /home/REDACTED/project.sln
ApplicationName='/usr/bin/mono64', CommandLine='"/usr/lib/mono/msbuild/15.0/bin/MSBuild.dll" "/tmp/NuGetScratch/3r24uwj4.84i.nugetinputs.targets" /t:GenerateRestoreGraphFile /nologo /nr:false /v:q /p:RestoreBuildInParallel="False" /p:RestoreUseSkipNonexistentTargets="False"', CurrentDirectory='/home/REDACTED', Native error= Cannot find the specified file
The file /usr/bin/mono64 does not exist. Anyone knows how I can fix this?
UPDATE
When I try tobuild the project, it fails with the followiing error:
Error: NuGet packages need to be restored before building. NuGet MSBuild targets are missing and are needed for building. The NuGet MSBuild targets are generated when the NuGet packages are restored. (My.App)
This seems to be connected with the previous error message.
I have just installed Ubuntu and for anyone interested I found a solution.
In /usr/bin, make a mono64 symlink to mono-sgen. mono is already a symlink to that.
I will investigate the other tools suggested.

Using and installing libVlc or GStreamer for QT in Visual Studio 2017

I would like to play an RSTP stream in Windows 10 using the QT Libraries in Visual Studio 2017.
Using DirectShowPlayer in QT Ctrator I have this error:
DirectShowPlayerService::doSetUrlSource: Unresolved error code 0x800c000d
I found some code examples that use libVlc or QT-Gstreamer.
Unfortunately, I'm new to the world of QT and the logic of building libraries.
I don't know anything about cmake and related.
Does anyone know an easy step-by-step procedure to install and use these libraries (or even "generic" libraries examples)?
Thanks in advance
I solved my problem!
You need to download the VLC-QT binaries for your O.S. (e.g. Windows 64bit) and unzip them into the QT directory relative to the compiler in use (eg "C:\Qt\Qt5.10.1\5.10.1\msvc2017_64\") respecting the destination folders (eg bin, lib , includes).
Then you have to go in your project properties and add the VLCQtCore.lib, VLCQtQml.lib and VLCQtWidgets.lib libraries to the list of libraries (e.g. Project Properties-> Linker-> Input-> Additional Dependencies)

How to deploy a sample GRPC [client-server] solution in raspberri pi in dotnet core

I am trying to run a simple GRPC client-server code in raspberri Pi running Raspbian os.
Language that i am using -C# dotnet core (2.1)
I downloaded a sample project from here.
This is a dotnet core project . I am able to run it in Windows environment, i am also able to modify .proto file in this code and run successfully.
I published the solution as it is with command
{ dotnet publish -r linux-arm }
When tried running same on Rpi, i am getting exception. Attached screenshot has the details of it.
Any help to get through this would be of great use
tl;dr The problem is the libgrpc_csharp_ext native library which currently does not get compiled and built for the arm7 processor. I've compiled it (on a pi) for arm7 and released a nuget package to bridge the gap until they support it all the way: https://www.nuget.org/packages/libgrpc_csharp_ext.arm7/
I'll update with a link to a blog post when I finish getting the rest of the tooling and template finished I'm working on.
fuller explanation: the Grpc.Core nuget package contains the native libgrpc_csharp_ext library that the dotnet implementation of grpc loads in NativeExtensions.cs then maps with PInvoke in NativeMethods.Generated.cs. Inspecting that package, you'll see a version of that library in each /runtimes/[win, osx, linux]/native folder. Unfortunately, no linux-arm version of the library is included. However, in the code, if the platform is linux, it will try to load the static library using the name as formatted here. Dissect that a little and you'll see that as of right now, any 'linux' platform that isn't '64bit' (which despite the proc on the pi being 64 bit, the distro of linux you're using on there, including raspbian, likely isn't) will look for libgrpc_csharp_ext.x86.so. When you dotnet publish -r linux-arm, you'll see that library there in the build output, but unfortunately, it's the wrong one (I think publish just grabs 'the closest one' when it can't find a specific library in the runtimes folder).
The nuget package I created above is compiled for arm7 - I actually cloned the grpc repo onto a pi and peeled away enough of the /csharp build to just cmake the libgrpc_csharp_ext. The 'trick' the package uses is to put the library in runtimes/linux-arm/native folder within the package, which dotnet core recognizes when publishing and pulls into the build output - but the library is still named libgrpc_csharp_ext.x86.so because of the way NativeMethods.cs formats the library name.

I'm unable to install Moq nuget package for ASP.NET5 (core CLR) Unable to locate Dependency moq.netcore >= 4.4.0-beta8

I'm playing with new Core CLR code and trying to implement some test project. I found that Moq at the current moment not support Core CLR and there is package from MS guys called moq.netcore. But when I'm adding this in my list of dependacies like moq.netcore": "4.4.0-beta8" I get this error:
Unable to locate Dependency moq.netcore >= 4.4.0-beta8
How to fix this?
You need to add special source to your nuget package manager to be able to locate dev version of packages by MS team.
URL of sources where you could find this packet is https://www.myget.org/F/aspnet-contrib/api/v3/index.json
if you prefer command line I think this command should work:
nuget sources add -name FeedName -Source https://www.myget.org/F/aspnet-contrib/api/v3/index.json
or click to nugget settings in Visual Studio and add it manually (you could check there for example)

How to run a Qt application on a system where Qt is not installed?

I have made an application using QtWebKit, Qt4. I have the binary generated in Fedora 16. Now, I want to run that application on another PC (running some other Fedora version), where Qt is not installed. How can I package my Qt application so that it can run on a platform where Qt is not installed? Is there any command line utility as well as QtCreator utility to do so. I have tried "deploy all" command, but it didn't have any affect.
Create an Installer with the Qt Installer Framework and just supply all needed shared libraries (Win/OSX) or compile statically. Under Linux there is always the problem between system-wide libraries or bundled libraries. The documentation https://qt-project.org/doc/qt-5.0/qtdoc/deployment.html should give you a good start
Obviously, you need to have access to the qt libraries, which are exactly the same version that you used to compile your application.
There are two options :
link qt libraries statically
create a RPM package (see this how)
Also check Deploying Qt Applications.
Since you're deploying using rpm, to systems where Qt 4 rpms are available, you don't need to do anything besides simply adding a dependency on the qt to your rpm's specfile. The user installing your package using yum localinstall will get the Qt dependencies automatically installed. That's the correct way of doing it - it will keep your package size small.
Of course you need a separate rpm build for every fedora/centos major version out there, but that's almost always a requirement.
If your package needs newer Qt version than the one provided by the platform packages, you can still make a specific version dependency (say qt >= 4.7.0) and have a readme that indicates that newer packages can be obtained from a 3rd party repository (epel etc.)
For deployment under Linux I've used Bitrock Installer Tool.
The main thing before deploying is to check your dependencies. You can do that by using command:
ldd appName | grep libQt
After that you'll see list of dependencies. You'll have to set environment variable LD_LIBRARY_PATH to let linker know where're your libraries. To do that:
export LD_LIBRARY_PATH=.
. means current directory
And after that:
./appName $*
After that you'll be able to use your executable with Bitrock Installer Tool.

Resources