I have a shared library written in C++ that I'd like to use with Mono under Linux,
I follow this guide http://www.mono-project.com/Interop_with_Native_Libraries
I got it to work, but I have to put my library file into /usr/lib or /lib folder.
Is there anyway that I could distribute and use my .so files and not copy them into /usr/lib or /lib but instead into my Mono application folder ? (current directory where the app running)
some user using the software might not have root / admin access, therefore they can't install/copy the files into /usr/lib or /lib
I think you have to use the environment variable LD_LIBRARY_PATH when launching your program:
LD_LIBRARY_PATH=. mono yourapp.exe
Related
My C# application(one single exe) will call C:\Program Files\7-zip\7z.exe when running, but not all computer have installed 7-zip, so is there a way that I can copy the whole 7-zip folder into my application and put it somewhere in run time then call its 7z.exe ?
Include the compression lib to your app.
The built-in compression in .NET with https://learn.microsoft.com/en-us/dotnet/standard/io/how-to-compress-and-extract-files
Or use with https://icsharpcode.github.io/SharpZipLib/
I developed an c# application using emgucv for face detection. According to emgucv documents folder "x86" or "x64" (depending on platform for which application is running) are need to be kept parallel to executing exe. So i did accordingly and run the project, application works just fine on my machine.
If I release this c# application along with all the dependent dlls and "x86" folder and copied to an windows 7 machine, after executing the application i get error Unable to load DLL 'cvextern' : The specified module could not be found. (Exception from HRESULT: 0x8007007E)
This is what i tried to solve the error:
I copied all the DLLs from folder "x86" to executing folder (i.e outside to x86 folder) and now application runs without any error.
So I am in confusion whether to keep x86 folder in executing folder or content of x86 folder. As per my observation both are working but what is recommended?
Normally the cvextern.dll file is located in the following folder:
project_folder\bin\x86\Debug\x86
project_folder\bin\x86\Debug\x64
The same goes for the x64 version:
project_folder\bin\x64\Debug\x64
project_folder\bin\x64\Debug\x64
The folder can also contain other files, e.g. opencv_ffmpeg310.dll. The Emgu.CV.World.dll and similar DLLs are located in the Debug/Release folder (one folder up).
Not sure which version of EmguCV you are using, I am using 3.2 so everything is built for x64. When I distribute my application, I create a x64 folder in the folder where the exe lives. In this x64 folder I put ALL of the DLLs from the EmguCV distribution. On my machine EmguCV lives in:
D:\Emgu\emgucv-windesktop_x64-cuda-tbb-ipp-icc 3.2.0.2682
So from the bin\x64 folder I copy everything to where the application exe is.
Doug
We have INF file which installs one .sys file to windows drivers folder. Scenario is as follows:
1) Installing the INF from File Explorer. Right click on INF file and click on Install. In this scenario .sys file gets copy under Windows\System32\drivers folder.
2) Created console application to install using RunDll32 / CMD under process object and install the INF file. In this scenario .sys file gets copy under Windows\System32\drivers folder.
3) Created x86 installer program having installer class to install using RunDll32 / CMD under process object and install the INF file. In this scenario .sys file gets copy under Windows\SysWOW64\drivers.
Our objective is to copy .sys file under Windows\System32\drivers folder irrespective of 32/64 bit flavor windows operating systems like WinXP, Windows7, Windiows 8/8.1/10.
Windows Installer (MSI) installs insist on installing 32-bit components in an x86 setup to the 32-bit locations. Attempts to direct 32-bit files to 64-bit locations will result in redirection. A 64-bit install can install to both.
Different MSIs are required for different architectures:
https://blogs.msdn.microsoft.com/heaths/2008/01/15/different-packages-are-required-for-different-processor-architectures/
and see in particular the WIN64DUALFOLDERS log and the accompanying remarks.
Have I an application using sqlite...
Ive tried this:
installing via ClickOnce Application setup (it works)
I Put SQLite.dll file together with .exe in the same folder. (it works}
hmm the folder with an .exe only (not working)
What I mean is when you build the project and get the .exe on the folder \bin\Debug and move it somewhere then when you run the app errors will not occurs.
I wondering if there's a way that i can run even without installing ClickOnce Application setup?
I thinking of setup the SQLite.dll on specific path reference? Is it possible to do that?
-thanks
System.Data.SQLite.dll is not part of the standard .NET Framework so it does not get installed in the GAC of the client machines when .NET runtime is installed at first.
that's the reason why you should have this dll referenced by your executable, distributed together and in the same folder as your exe is deployed.
or you could distribute it somewhere else like in a sub-folder of your application setup and have proper entries in the configuration file or in the .NET C# code to specify where assemblies not found in the standard locations have to be loaded from.
You can use Nuget to get the package installed. For my case, it automatically created 2 subfolders for me, which is x86 and x64, I just followed the folder structure in the bin folder, and it worked fine for my case.
I have created a windows application and I have published it by publishing wizard.
Now I want to make it portable so that the end user does not need to install the application.
The application is very simple and the only dll it is referencing is office outlook interop.
Please let me know how can I make the application portable
You should be able to just copy the files in the bin folder and launch the app from there. This is called "XCOPY deployment", long marketed as one of the major benefits of .NET applications.
Just make sure that you set the properties on the Office reference so that the DLL is copied into the bin folder, too.
However, for this to work, the client machine must have the appropriate version of the .NET Framework installed. So it won't be truly portable unless you can control the configuration of all target machines, but at least it's a good start.
There's no need for the Winforms application to be installed. Just set Copy Local to true for your external referenced dlls. Build your project and copy all the files in /Bin/Release or /Bin/Debug (depending on project settings).
The only thing that has to be installed on the client's machine is the appropriate .Net Framework version.