Type or namespace 'Sqlite' could not be found in SQLite.cs - sqlite

I have a Windows Phone 8 app that utilizes SQLite. The app has many database functions, and includes a sqlite database file which, upon running the app, is copied to the local folder and accessed. All of this worked with no problem until I first switched to release build, upon which it did not work.
I "fixed" this by deleting all NuGet references and .dll references and started over following the steps here:A Workaround to Use SQLite in a Windows Phone 8 Application
I am having a frustrating problem where, after switching from debug to release build, or vice versa, 'Sqlite' is once again no longer recognized.
I get the following errors:
The type or namespace name 'Sqlite' could not be found (are you missing a using directive or an assembly reference?)
These errors are coming from SQLite.cs, specifically these lines:
using Sqlite3 = Sqlite.Sqlite3;
using Sqlite3DatabaseHandle = Sqlite.Database;
using Sqlite3Statement = Sqlite.Statement;
How is this possible? I saw some similar questions on here, but all of them simply said to delete and re-add the references and the problem inexplicably goes away. This is not working for me.

Follow this article to configure your project. Also explained here
Second you will need to go to the GITHUB website and download the
code for SQLite-net-wp8. This is a c++ project you will need to
access a sqlite database.
Make you sure you set Conditional compilation symbols: USE_WP8_NATIVE_SQLITE and release is x86 or ARM.
Tested on VS Profesional 2013, Release build (x86, ARM)

Go thorough bellow link
Windows Phone 7 Native Database Programming via Sqlite Client for Windows Phone
Hope it will help you

Related

Unable to load DLL sqlite3 in Universal Windows App running on Mobile

I am developing a UWP. I am using the sqlite-net-pcl library. After upgrading my Application from RC to RTM , I got a runtime error - sqlite3.dll could not be found - if it runs on a Mobile emulator or a device. It worked prefectly after I added a reference to C++ 2013 Runtime Package and I ran it in Local Machine.
Exception Message:
Message "The type initializer for 'SQLitePCL.raw' threw an
exception." string
The innerexception message:
{"Unable to load DLL 'sqlite3': The specified module could not be
found. (Exception from HRESULT: 0x8007007E)"} System.Exception
{System.DllNotFoundException}
Of course I could not add a referece to 'Sqlite for Universal App Platform' because I am geting the following error
Severity Code Description Project File Line Error Payload contains
two or more files with the same destination path 'sqlite3.dll'. Source
files: C:\Program Files (x86)\Microsoft
SDKs\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UAP.2015\3.8.11.1\Redist\Debug\ARM\sqlite3.dll
C:\Users\sMavrikis.nuget\packages\SQLitePCL.raw_basic\0.7.1\build\native\sqlite3_dynamic\winrt81\arm\sqlite3.dll TestApp1
Add a reference to 'SQLite for Universal App Platform'
This will trigger the error:
Payload contains two or more files with the same destination path 'sqlite3.dll'.
This error occurs because of different version of sqlite3.dll in both the locations marked by the error.
Resolve this error by simply copying
C:\Program Files (x86)\Microsoft SDKs\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UAP.2015\3.8.11.1\Redist\Debug\ARM\sqlite3.dll
to
C:\Users\%USERNAME%\.nuget\packages\SQLitePCL.raw_basic\0.7.1\build\native\sqlite3_dynamic\winrt81\arm\sqlite3.dll
overwriting existing file.
Rebuild your project. It should compile now.
If you look at the two conflicting locations, one seems to be coming from a more official Microsoft extension for UWP, while the second is coming from a nuGet package.
When I encountered this error, I needed the functionality of the nuGet package, so I decided to keep it and drop the other reference. I right clicked on the project in the solution explorer and went to Add->Reference and then unchecked the reference to SQLite. Seemed less error prone than copying the file from one location to the other to me.
I was getting the same error messages. I had started by using SQLite-PCL which also required SQLite for Universal App Platform as a reference. Later I switched to SQLite.Net-PCL. That is when I got those errors. In researching a solution I found this page. It worked for a bit. Eventually I removed the Reference to SQLite for Universal App Platform and the errors went away.
late reply, but had the issue now; What fix it for me was to do Nuget Package update on all the project in the solution as one of the packages was still using the old reference and was pulling through to the Running project referencing the other project that was out of date.
I fixed a similar issue by selecting x64 or arm in the compiler configuration.
Error Payload contains two or more files with the same destination path 'e_sqlite3.dll'. Source files:
C:\Users\xleon.nuget\packages\SQLitePCLRaw.lib.e_sqlite3.v140\1.1.0\runtimes\win10-arm\native\e_sqlite3.dll
C:\Users\xleon.nuget\packages\sqlitepclraw.lib.e_sqlite3.v140\1.1.0\runtimes\win10-x86\native\e_sqlite3.dll
but this, of course, won´t allow you to run the emulator
Right-Click on the UWP Project and choose Properties.
And make sure the Solution Platform target matches the Project Platform target.
If they are different you will get the build error about copying files to the same destination with the same name (but different target platforms).
I managed to solve the disparity by putting a conditional in the UWP .csproj for including the SQLite dll
<SDKReference Include="SQLite.UWP.2015, Version=3.19.3" Condition="'$(Configuration)'=='Debug'">
<Name>SQLite for Universal Windows Platform</Name>
</SDKReference>
I needed to run with the UWP version for debugging, else my XAMl designer would blow up with "Can't find SQLite.dll..."

New windows universal app with SQLite 3.8.7.4 doesn't work

I created a windows universal app (windows 8.1 and windows phone 8.1 winrt) working with SQLite 3.8.7.4.
But with SQLite, nothing works ! (The type or namespace name 'SQLite' could not be found)
YES I have included SQLite in my references :
YES I tried to clean my project and to build it again,
But I have no result. Does anyone have any idea?
I tried to update SQLite to 3.8.7.4 version on an existing app and it works, so, i continue to search why.
P.S : I'm using .NET 4.5
I found the difference between my 2 projects :
In my existing app, there are 2 files : SQlite.cs and SQLiteAsync.cs
But these files are not created on the 2nd project, that's why i can't find SQlite reference on my class.
These files are included by installing "sqlite-net" package from nugget.
In universal app if you add this 2 files : SQlite.cs and SQLiteAsync.cs in the "Shared project" then you will automatically get the reference of SQlite libraries in both project..
Refer the following link and follow the steps mention it'll help you
http://www.codeproject.com/Articles/826602/Using-SQLite-as-local-database-with-Universal-Apps
SQlite.cs and
SQLiteAsync.cs.
These two files are also missing from my project and when I try to install SQLite-net visual studio give me error that it is already installed. I spend a lot of time on finding why it is not adding these files to my project. If you are also suffering from same problem just uninstall it then reinstall it will start working.
:)

Missing dependencies in latest rdfWebDeploy

I am trying to deploy a sparql endpoint using dotNetRDF to www.myapp.com/sparql.
rdfWebDeploy -test worked without errors but then running -deploy shows that there are missing assemblies in these tool.
First is complained about missing NewtonSoft.Json.Net35.dll, so I went into my nuget package and grabbed the dll in the net35 folder. However, this dll is named NewtsonSoft.Json.dll despite the 35 build...so I just renamed it has Net35 in the name and dropped it into rdfWebDeploy.
This worked so far, then it complained about MySql.Data.dll. I downloaded the MySql Connector which had the dll and dropped it into the rdfWebDeploy folder as well.
Finally rdfWebDeploy succeeded, however running the site produced
Could not load file or assembly 'Newtonsoft.Json.Net35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
How can I get this tool to deploy to my Net 4.5 MVC site and get past this Newtonsoft issue? Also, how will I know my endpoint ("/sparql") is working, will it display something if I go there?
This tool hasn't been updated in a while and sounds like it has fallen behind the main code base somewhat, we haven't used the old .Net 3.5 builds of Json.Net in a long time nor do we have any dependencies on MySql.Data anymore. So this sounds like a bug which we'll look to fix in our latest release - this has been logged as TOOLS-424
In terms of what you will see when this is working it will depend on the configuration you have provided for your endpoint(s), a fairly default configuration would give you a query form such as the one seen on our live demo at http://www.dotnetrdf.org/demos/leviathan/ - you can see the corresponding configuration for our demos at http://www.dotnetrdf.org/demos/sampleConfig
Update
The mentioned bug has now been fixed and an up to date and working version of this tool will be available in the next dotNetRDF release currently scheduled for the end of July 2014.

MvvmCross, SQLite, Store App?

I can get MvvmCross working with a Windows 8.0 Store App.
I can get SQLite working with a different Windows 8.0 Store App.
I cannot figure out how to get MvvmCross + SQLite working on a Store app.
I always get this Exception:
Failed to construct and initialize ViewModel for type Flux.Core.ViewModels.TestViewModel from locator MvxDefaultViewModelLocator - check MvxTrace for more information
I've spent the entire day searching with google, hoping to solve this myself. The KittenDb example is about as close as I've come, but there's no Store app example in there. (I got the Kitten example working no problem on Android.)
Is there any working example out there?
Thanks!
SQLite for Windows Store is a C++ component and comes in separate ARM, x86 and x64 binaries.
To install it, you need to add a Visual Studio extension - instructions in http://blogs.msdn.com/b/robertgreen/archive/2012/11/13/using-sqlite-in-windows-store-apps.aspx - and then reference that extension from your UI project.
To then link the correct platform version of the Cirrious.MvvmCross.Plugins.Sqlite.WindowsStore.dll assembly to your UI project, you further need to adapt your .csproj file with a <Choose> block a bit like the one in https://nuget.codeplex.com/discussions/446656
There is an open issue within MvvmCross to make SQLite easier to use from nuget (see https://github.com/MvvmCross/MvvmCross/issues/307) but I don't know if anyone is actively working on addressing this issue currently - currently users seem to be just putting up with challenges of different processor architectures and following the manual steps to adapt their projects.

What is assembly EnvDTE 8.0.0.0?

I made a small console app in VS 2010 and I just published it and went to install it on another pc (Win XP Sp3). The installer made me update the .Net framework, which I did and then when i went to run th second part which actually installs the app I am getting the following modal box:
Unable to install or run the application. the application requires that assembly EnvDTE Version 8.0.0.0 be installed in the Global Assembly cache (GAC) first.
Please contact your system administrator.
What in the world is EnvDTE v8.0.0.0????
This is a tiny app which does a small web call to an api and returns the results. I do make a DB call for a select and and update using some generated code from Codesmith/Nettiers (including enterprise Library). These files are referenced in the app though already.
Any ideas how to fix or work around this?
EnvDTE.dll is, as Zabba said in his comment (not sure why he didn't answer with this) used to automate Visual Studio. For some reason, you have added a reference to this in your project.
Open your solution, look at the References node in all your solution projects, and delete any reference pointing to EnvDTE.
It doesn't normally magically appear in your reference list; you either have to add it, or the project template you used to create your project referenced it, or you added an item whose template added this reference.

Resources