How to add sqlite3.dll for win rt as a reference? - c#

I am building a Windows Store app that targets an ARM device (Windows RT tab), I installed the NuGet pkg SQLite-net and it works perfectly under x86 platform. But when I tested on the ARM device (note that platform target has been setup for ARM by this time), I get the following error:
An exception of type 'System.DllNotFoundException' occurred in
App1.exe but was not handled in user code
Additional information: Unable to load DLL 'sqlite3': The specified
module could not be found. (Exception from HRESULT: 0x8007007E)
I have not been able to add the sqlite3.dll from the SQLite.org website, I tried to add as a "existing item", change its properties as content, copy always; but I keep getting the same error.
my Connection path is following:
// C#
public static string sqlitedbPath = Path.Combine(
Windows.Storage.ApplicationData.Current.LocalFolder.Path, "mydb.s3db");
I am sure I have the wrong DLL, but I am having I hard time to change it.
Does somebody has a good solution?

Related

EmguCV: Unable to load DLL 'cvextern': The specified procedure could not be found

When publishing project to windows server 2003 (old test machine) I get following error when trying to call open cv functions.
Additional information: The type initializer for 'Emgu.CV.CvInvoke' threw an exception.Unable to load DLL 'cvextern': The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)
I am using EmguCV 3.4.1 version with uploaded libraries:
vcruntime140.dll
opencv_ffmpeg341.dll
msvcp140.dll
cvextern.dll
concrt140.dll
To the Emgu package nothing extra (dll's) were added and on developer machine I could develop the application.
I keep wondering whether additional native dll's should be added. I downloaded binaries for 3.4.1 version. The files go like that:
opencv_core249.dll
opencv_highgui249.dll
Those two above where in 3.4.1 package. When i copied them to program directory it didn't help either.
What's more I have no idea how to track down the problem.
Process monitor doesn't show that the process is looking for something that cannot be loaded.
In the inner exception I am given only this exception: Unable to load DLL 'cvextern': The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)
I had to install "Desktop Experience" feature on my server. Because server 2003 doesn't seem to have it, I had to move it to another server 2008 host.

LibX11 Exception on C# Visual Studio

I want to create a program in C# that uses OpenTK. I download the nuget package with this:
nuget.exe install OpenTK
and also
nuget.exe install OpenTK.GLControl
But whenever I reference these 2 files, the console ends up printing this error:
Exception thrown: 'System.DllNotFoundException' in OpenTK.dll
Additional information: Unable to load DLL 'libX11': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
And upon further investigation, libX11 is a Linux package but I'm running on Windows 10. Is there a way to bypass the Linux check and be able to use it on Windows?
There is no code with it because I can't even properly reference the file without it printing that exception.
I have attempted to put this into System32 and all to no avail.

Project can't recognize dll in x64 machine

I need to create a Custom Download Manager, because I don't want the Internet Explorer to fire de Default File Download Dialog.
Then, I got this example to do: http://www.codeproject.com/Articles/18935/The-most-complete-C-Webbrowser-wrapper-control
I've downloaded the example code and tried to run it. after registering the DLL the program didn't recognize. The whole problem is the x64 and x86 bits thing. I work on a x64 bits machine, and it doesn't work
Then I got this post: wrap 32 bit dll for 64 bit operating system to work with regsvr32.exe
and tried the solutions, but the same exception was still there.
Exception:
An unhandled exception of type 'System.UnauthorizedAccessException' occurred in csExWB.dll
Additional information: Access denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
I really need your help, and don't know what else to do. This download manager is vital to my project.
I appreciate any help.

C# .Net App On Windows XP Fails Shell32 Code for Renaming Shortcut

I have a situation where I have a windows Desktop APP in .Net C# that must on both Windows 7 and Windows XP rename a shortcut. I have it working in Windows 7 but on XP this fails.
.Net 4.0 Client Profile and Extended is installed on XP and all other parts of the applciation are functioning on XP. The project has a reference Interop.Shell32 (MIcrosoft Shell Controls and Automation through COM Interop rahter than pinvoke) and the code is simply the following:
var shl = new Shell32.Shell();
argStrLnkPath = System.IO.Path.GetFullPath(argStrLnkPath);
var dir = shl.NameSpace(System.IO.Path.GetDirectoryName(argStrLnkPath));
var itm = dir.Items().Item(System.IO.Path.GetFileName(argStrLnkPath));
itm.Name = "My Shortcut Name";
The above works in 7 but not XP. The following versions of the Shell32.dll exist:
Win7 Shell32.dll version 6.1.7601
WinXP Shell32.dll version 6.00.29.6242
When I spy the XP shell32dll in the object browser, the same objects exist, so the functionalty should be there (unless I'm not seeing something important).
My project is set to build as x86 platform for both machines. For the reference, I have tried the Embed Interop Types as True and also copy local as False.
I have an msi installer but is there something I need to do on the target XP machine? And should I copy Local? Any ideas on the propper way to get this working?
I have run the code on that XP Machine and receive the following from teh Event Viewer:
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidCastException
Embed Interop Types for Reference = True: The stackTrace for this error is:
Unable to cast COM object of type 'System.__ComObject' to interface type 'Shell3
2.Shell'. This operation failed because the QueryInterface call on the COM compo
nent for the interface with IID '{866738B9-6CF2-4DE8-8767-F794EBE74F4E}' failed
due to the following error: No such interface supported (Exception from HRESULT:
0x80004002 (E_NOINTERFACE)).
Embed Interop Types for Reference = False: The stackTrace for this error is:
Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.FileNotFoundException
Issue Solved! I hadn't realized that when you make those types of COM Interop inclusions, they must have a Setup Project (msi installer if going on another system). Also, another caveat is that if you have already created a setup project, you must Add > project Output again. This will automatically pull all of those interop inclusions in under the Detected Dependencies folder. This solved my issue.

Unable to load DLL VistaDb20.dll because of an invalid access to memory location (HRESULT: 0x800703E6)

I have a project that was built in Visual Studio 2005 in C#. I created an installer for the Windows application (in VS2010) and it installs and works fine on Windows XP SP3. I tried installing it on Windows 7 32-bit and it says installation is successful but when I try to open the application I receive this error message:
A fatal error has occurred. Unable to load DLL 'VistaDb20.dll': Invalid
access to memory location. (Exception from HRESULT: 0x800703E6)
People suggested I run this in the command line:
regsvr32 VistaDb20.dll
I get the error message:
The module "VistaDb20.dll" was loaded but the
entry-point DllRegisterServer was not found.
Make sure that "VistaDb20.dll" is a valid DLL or OCX
file and then try again.
So then I tried regasm VistaDb20.dll /tlb:VistaDb20.tlb using the .NET Framework Assembly Registration Utility 2.0.50727.4927 and get error:
RegAsm : error RA0000 : Failed to load 'VistaDb20.dll' because it is not a valid .NET assembly.
I am not sure how to get my application running on Windows 7 with this .dll problem. Any help would be appreciated. This application and the database was created using VistaDB 2.1
I guess I can't change the actual dll since I did not create it but maybe I have to change some properties of the dll in Visual Studio?
I had this error while trying to registering my VB .NET assembly using RegAsm command:
RegAsm : error RA0000 : Failed to load 'VistaDb20.dll' because it is not a valid .NET assembly.
I solved the problem buy executing RegAsm of the right .NET Framework.
I mean you should use the tools of the same Framework that you make as target in your advanced options of compilation (VS2010).
According to this your problem is that this DLL is not compatible with DEP. You'll need to disable DEP to workaround this but in the long term you should try to wean yourself off this particular dependency.

Categories

Resources