Unable to load DLL 'sqlite3': in windows phone app. - c#

I'm working on a windows Phone OLD application. I'm getting this issue related to SQL3.dll. in visual 2015.
Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
What I've tried, Done Cleaning all project, added sqlite.dll in Bin/debug folder, but I could not overcome this issue.
here is a screenshot.
I've tried adding a dll as reference (sqlite-winrt-3220000.vsix) but this is not compatible.
Any help would be appreciated.

Add the dll as a reference:
Right-click in "References" in the project you want to use it in and select "Add reference".
Select the option "Browse" and use the browse button to select the dll you want to include.
Add a using statement to the class.
After this you can use the dll in the project.

I've tried adding a dll as reference (sqlite-winrt-3220000.vsix) but this is not compatible.
SQlite is distributed as a VS extension. To add reference to your project, right click on References, “Add References”, “Windows Phone 8”, “Extensions”, check “SQLite for Windows Phone”, press OK.
No other steps are required, you don’t need other references and you don’t need to specify or deploy DLLs manually.
Also sqlite has different extension for WP8.1, you should probably install another one, sqlite-wp81-winrt-3220000.vsix.
Update: I think you’re trying to build for a platform that’s unsupported by SQLite library. SQlite for windows phone only supports 2 platforms, intel 32 bit (for emulators) and ARM (for devices and for the marketplace). It does not support AMD64, and it does not support “Any CPU”. You’re probably trying to build “Any CPU”, it’s usually the default platform for .NET.
Another possible reason is wrong project type. Your project has to be windows phone 8.1 app, not universal, i.e. the project name in the solution explorer panel must end with ”(Windows Phone 8.1)”
Update 2: I’ve compiled a simple app that uses sqlite, run it in emulator and it worked flawlessly on my PC. Ensure your references look like this:
If you have the same, make sure you have VS 2015 Update 3 installed. If you already have it, repairing your visual studio installation might help.

Related

UWP Unable to activate windows store app error: the app didn't start

I am asking this question - and I know that there are multiple ones here in StackOverflow and other sites - because I have tried everything out there but no solution.
My problem is that this error that appears whenever I try to start the UWP app:
I tried switching between platforms (x64 and x86)
I tried to clean the solution and rebuild
I made sure that the project was on the C drive
I'm using Visual Studio 2017.
I've had this problem for a while. People suggest a lot of random workarounds (clean the project, move the project folder, repair/reinstall Visual Studio, delete configuration files, and so on).
This is the most sensible solution I've found, and the one that worked for me.
Basically, just open the Project properties, Build tab and make sure the option "Compile with .NET Native tool chain" is checked.

Unable to find Windows.Devices.Enumeration and Windows.Storage.Streams

I need to use Windows.Storage.Streams and Windows.Devices.Enumeration in my Winforms application on Windows 7 to access and manipulate Barcode reader, but unable to find it to Add Reference. Not sure if can download it somewhere. I was able to find and download Microsoft.PointOfService and added reference to my project, but not the first two libraries.
Please advise.
The Windows.Storage.Streams and Windows.Devices.Enumeration namespaces are part of the Windows Runtime. To use them you need to target Windows 8 or above. They aren't available when targeting Windows 7.
How to access the Windows 10 APIs from WPF
You can access the Windows 10 APIs from a pre-existing WPF project. To do so, go to your Solution Explorer window and …
Right click on References.
Select “Add Reference…” from the context menu.
On the left of the Reference Manager, choose Browse and find the following file: C:/Program Files (x86)/Windows Kits/10/UnionMetadata/Windows.winmd.
Add it to your project as a reference. Note: You will need to change the filter to “All Files”.
Right click on References. Select “Add Reference…” from the context menu. On the left of the Reference Manager, go to Browse and find the directory “C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETCore/v4.5”. Add System.Runtime.WindowsRuntime.dll to your project.
Learn More Calling Windows 10 APIs From a Desktop Application
Just to be helpful to others that arrive here through Google, Microsoft has some NuGet packages to access Windows-specific APIs like that without the need to import or reference Windows libs manually. More info can be seen on their documentation here.
For those trying to use it from Windows 8/8.1, add a reference (like Sajeeb's answer) to the files at 32-bit C:\Windows\System32\WinMetadata or 64-bit C:\Windows\System32\WinMetadata respectively.
I believe those namespaces are not part of Windows Apps libraries. I don't think a WinForm project is able to use them. Personally, I don't have newer versions of VS, so I am not sure of that. But there is supposed to be a new project type in VS2015 onwards.

How to use SQLite on new Windows 8.1 Store app (Visual Studio 2013)

So, I installed Visual Studio 2013 on my Windows 8.1 box. I want to experiment with it and created a new Windows Store Grid App. I want to persist data on a SQLite database, apparently the database of choice for WinRT apps.
Quickly found links to the vsix needed in order to be able to use the SDK: SQLite download page, and downloaded sqlite-winrt81-3080002.vsix.
Installed it, then in my project, added the reference to the newly installed SDK (right click references, add reference, navigate to Windows, select extensions and tick SQLite for Windows Runtime (Windows 8.1) checkbox.
Also quickly found that it won't compile on Any CPU. On Configuration Manager, selected Debug, x64 active platform, that made me able to compile the application.
Finally, while attempting to use the namespace SQLite I noticed VS 2013 isn't recognizing it. Attempted many things like adding reference to the .dll directly, exploring the component to see which namespaces were available (which doesn't show anything), and I'm quickly running out of ideas. Because it's kinda new thing, and with limited interest, google, the saviour, doesn't want to save me today.
So, how one would be able to use the SQLite SDK in their Visual Studio 2013 projects, targeting Windows Runtime 8.1?
These are the contents of my csproj file
UPDATE
Stupid me, thought there was no managed land (.net) in Metro style land. Sorry for causing any confusion.
I installed the VSIX for SQLite and noticed that it is a native DLL to be used in Windows Store 8.1 C++ apps. It is not for managed C# projects.
The current NuGet package for SQLite from what seems to be the 'official' SQLite team is only working for .NET 4.5, if you try to install it, it will error saying it does not support .NET 4.51.
There is also the NuGet package SQLite-net, which works for .NET Windows Store apps. All you need to add is the SQLite using statement.
You will need this NuGet package as it is the managed wrapper for the SQLite, without you will not be able to properly reference the right DLL for SQLite.
Here is the link to the project information from that NuGet package. SQLite Runtime Support
Here is an article on how to use SQLite with Windows Store apps in VS2012 but it should still all apply:
SQLite and Windows Store Apps

Cannot reference dll file in project

This is my first time trying to use a dll file in visual studio (2012) so I am not sure what I am doing wrong. I am trying to get sqlite into my project following this tutorial
I right click on the project in the Solution Explorer and click Add References
I then click on the browse tab and find where I have the dll file,click ok then ok in visual studio and I get an error saying Reference to *dll path* could not be added. Please make sure the file is accessible and that is it a valid assembly or COM component.
did I miss a step here or something?
The file is located in my dropbox folder (where my whole project is) and the project is a windows store application is that matters
Not a direct answer but instead of referencing the dll directly, you should install the Visual Studio extension for SQLite. The extension includes the dlls for all platforms (x86, x64, ARM). It also makes sure that the right dll is used for the platform that you are building for.
After you install the extension, it will appear in the references dialog under Windows -> Extensions. Also, when you use the extension, you must change all your project build configurations to be x86 or x64 (on the desktop) or Arm (for Arm devices). It will fail to build if you use AnyCPU.

"Application requires that assembly *** be installed" error while trying to install my ClickOnce app

Here's an error I get when I try to install my application from the publish location:
I have my application (and a DLL used by it) linked to version 1.61.4111... of QWhale.Common which is a 3rd party DLL. I have been used this version since about 4 updates ago and never had this problem. I have no idea which part of my application or DLL could be trying to link to the older version. The only thing I did different on this version is that I moved my application's project folders to a new location in my computer.
Where should I start trying to find where this problem is coming from? Did you ever have this problem before?
As Yahia commented, this can be a licensing issue but if you've been using this assembly for a while and if you've been compiling it with your application, there is a chance that a setting associated with the file could have changed with your projects settings.
Assuming you are using Visual Studio, I recommend opening your Projects properties window and navigating to the Publish tab and opening the Application Files Dialog.
From there, find the referenced, 3rd party assemblies make try setting the Publish Status to Include and the DownloadGroup to (Required).
Save your changes and republish your application.

Categories

Resources