sqlite-net-pcl nuget missing the API for async sqlite connection - asynchronous

I am working on a UWP app and I can't find the async API mentioned here.
https://github.com/praeclarum/sqlite-net#asynchronous-api
I have installed only the sqlite-net-pcl 1.5.231 nuget. (https://www.nuget.org/packages/sqlite-net-pcl)
Am I missing anything?

With my tests, there's no problem. I can call the async APIs. Please check if you add the SQLite.cs and SQLiteAsync.cs to your project like the Source Installation mentioned.
By the way, you could follow the official document Use a SQLite database in a UWP app to use sqlite database in your UWP app.

Related

How to update nuget packages in ASP.NET "Websites" using CLI

ASP.NET Websites is legacy application type - it doesn't have a solution or project file.
That being said, can I use Nuget's CLI to update an ASP.NET Website? I'm guessing that it's not possible since Nuget's CLI requires a solution/project file but I'm hoping that I'm wrong. Please prove me wrong people.
Thanks

Adding UWP option to Xamarin cross-platform application

I made a simple Xamarin cross-platform sqlite application for Android and IOS. I want to add Universal Windows Phone version too. To do that i followed this steps. I installed SQLite.Net-PCL from nuget manager. But i still need to write something for sqlite connection. In this link, at step 6 there is code for this but its for windows phone 8. Can you please help me?
Xamarin.Forms supports database-driven applications using the SQLite database engine, which makes it possible to load and save objects in shared code.
Xamarin.Forms applications can use the SQLite.NET PCL NuGet package to incorporate database operations into shared code by referencing the SQLite classes that ship in the NuGet. Database operations can be defined in the Portable Class Library (PCL) project of the Xamarin.Forms solution, with platform-specific projects returning a path to where the database will be stored.
But i still need to write something for sqlite connection. In this link, at step 6 there is code for this but its for windows phone 8. Can you please help me?
Windows 10 Universal Windows Platform (UWP)
Add the SQLite-net PCL NuGet to the UWP project by right-clicking and choosing Manage NuGet Packages.
Once the reference is added, implement the IFileHelper interface using the platform-specific Windows.Storage API to determine the data file path.
using Windows.Storage;
...
[assembly: Dependency(typeof(FileHelper))]
namespace Todo.UWP
{
public class FileHelper : IFileHelper
{
public string GetLocalFilePath(string filename)
{
return Path.Combine(ApplicationData.Current.LocalFolder.Path, filename);
}
}
}
Details please reference Xamarin.Forms Local Databases. The accompanying sample application is a simple Todo-list application.

Entity Framework Code First Approach to Xamarin.Forms PCL app

Can I have a .NET Class Library project with Entity Framework 6.1.1 (in windowsazure.mobileservices.backend.entity nuget package) work with Xamarin.Forms PCL app? Is this achievable? If not what are the possible complications?
Question Background:
I am working on a Xamarin.Forms cross platform PCL app with Azure Mobile Services back-end, targeting Android, iOS, Windows 8.1 and WinPhone 8.1. I actually dont care about Windows 8.1 but Visual Studio does not allow me to remove this target. So it stays.
Azure Mobile Services is setup, but I need the tables to be generated automatically (strongly avoiding manually typing table definitions in azure portal). I decided to go EF code first way with windowsazure.mobileservices.backend.entity nuget package to achieve this. However, the Xamarin.Forms PCL project does not support additional assemblies.
I am thinking of adding this package into a separate class library project and referring to it from the PCL project.
Thanks for your help!
The EntityData type is the required superclass of DTOs on the server SDK. Unfortunately, it has dependencies that are not supported in a PCL project, so it has to be used with a full .NET 4.5 project.
You could instead use partial classes to share DTOs between client and server. Just put all of the non system property types in a common code file that's shared between client and server. Then, on the client, add the system property implementation (ID field, UpdatedAt optionally, Version optionally). On the server, add another partial class definition that inherits from EntityData.

Using SQLite-Net Extensions in winRT

I would like to use the SQLite-Net Extensions library in my winRT project.
https://bitbucket.org/twincoders/sqlite-net-extensions
To support sqlite in my Windows 8.1 App I've currently installed SQLite for Windows Runtime (Windows 8.1) as VS Extension and sqlite-net via NuGet.
Extension: http://visualstudiogallery.msdn.microsoft.com/1d04f82f-2fe9-4727-a2f9-a2db127ddc9a
sqlite: https://www.nuget.org/packages/sqlite-net
To get it working I tried to download the source and build it with the sqlite libs we can use for winRT. In order to add a reference to SQLite for Windows Runtime I need to change the target to Windows 8.1 only. Doing that will result in many errors like: "The name 'BindingsFlags' does not exist in the current context" "Instance argument: cannot convert from 'System.Type' to 'System.Reflection.MemberInfo'"
I've also tried to link the SQLite-Net-PCL directly from my project but in the end it's the same situation.
I really need to add relationships to my sqlite database and would be very very thankful for every help I can get!
Attached you can find a screenshot of my VS2013 where I've changed the references of SQLiteNetExtensions to use the required winRT libraries.
Many many thanks in advance for any help you can give me!
Following steps work for me without the need to download the source and possible compilation error:
(I have the following assumptions: I only target Windows 8.1 [As of yours] and I use Visual Studio Premium 2013 Update 3)
In Visual Studio go to Tools-Extensions & updates-online section and look for sqlite. This package will contain
required SQLite Binaries.
Add a Reference to SQLite for Windows Run-time in your project Reference
Add a Reference to Microsoft Visual C++ Run-time package
In Nuget package manager console run "Install-package sqlite-net"
In Nuget package manager console run "Install-Package SQLiteNetExtensions"
Now you will have a project which Targets Windows 8.1 and also has reference to both SQLiteNetExtensions. Above steps was originally recommended in : Using SQLite in a Windows Store App
Below is the screenshot of the SQLiteDemo project references downloaded from the link I mentioned earlier which also has reference to SQLiteNetExtensions :

Remove Application Insight from application on Visual Studio 2013

On Visual Studio I added application insight to a project which creates a ApplicationInsights.config and not sure what other files were added to the project.
Thing is, doing right click and press Add Application Insight was pretty straight forward. Now I'm looking with no success a way to remove the application insight for that project.
How can I achieve that ?
On production server, using DebugView, I see the telemetry logs, even after shutting down the Application Monitor Services on the server.
Any help is appreciated, I want to completely get rid of application insight on that application.
I just wanted to add to the answers already given, having just gone through this process with an ASP.NET MVC 5 project.
Uninstall Using NuGet
As the other answers say, the best way to remove Application Insights is through Nuget: Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution.
I found it best to remove Microsoft.ApplicationInsights.Web and all its dependencies first, then Microsoft.ApplicationInsights.Javascript API.
This removed everything except:
the ApplicationInsights.config file,
a script snippet in _Layout.cshtml,
both of which I removed manually.
What Microsoft has to say
The Microsoft Azure documentation here: https://azure.microsoft.com/en-gb/documentation/articles/app-insights-troubleshoot-faq/, says:
What does Application Insights modify in my project?
The details depend on the type of project. For a web application:
Adds these files to your project:
ApplicationInsights.config.
ai.js
Installs these NuGet packages:
Application Insights API - the core API
Application Insights API for Web Applications - used to send telemetry from the server
Application Insights API for JavaScript Applications - used to send telemetry from the client
The packages include these assemblies:
Microsoft.ApplicationInsights
Microsoft.ApplicationInsights.Platform
Inserts items into:
Web.config
packages.config (New projects only - if you add Application Insights to an existing project, you have to do this manually.) Inserts
snippets into the client and server code to initialize them with the
Application Insights resource ID. For example, in an MVC app, code is
inserted into the master page Views/Shared/_Layout.cshtml
Remove Manually
To remove Application Insights without NuGet, or if like me you don't trust it and want to know which files are removed, I followed these steps:
Remove application insights from the web.config, under system.webserver.modules, search for ApplicationInsightsWebTracking.
Remove all Microsoft.AI (Application Insights) prefixed references from project references.
Remove all Microsoft.ApplicationInsights packages from package.config.
Delete ApplicationInsights.config file.
Remove script from _Layout.cshtml:
var appInsights=window.appInsights||function(config){
function r(config){t[config]=function(){var i=arguments;t.queue.push(function(){t[config].apply(t,i)})}}var t={config:config},u=document,e=window,o="script",s=u.createElement(o),i,f;for(s.src=config.url||"//az416426.vo.msecnd.net/scripts/a/ai.0.js",u.getElementsByTagName(o)[0].parentNode.appendChild(s),t.cookie=u.cookie,t.queue=[],i=["Event","Exception","Metric","PageView","Trace"];i.length;)r("track"+i.pop());return r("setAuthenticatedUserContext"),r("clearAuthenticatedUserContext"),config.disableExceptionTracking||(i="onerror",r("_"+i),f=e[i],e[i]=function(config,r,u,e,o){var s=f&&f(config,r,u,e,o);return s!==!0&&t["_"+i](config,r,u,e,o),s}),t
}({
instrumentationKey:"RemovedKey"
});
window.appInsights=appInsights;
appInsights.trackPageView();
Remove ai.0.15.0-build58334.js & ai.0.15.0-build58334.min.js from Scripts directory.
Clean & Rebuild all.
Unless I'm misunderstanding the question, you should only have to remove one extension and possibly one nuget package.
Uninstall the Application Insights Tools for Visual Studio extension and remove the Application Telemetry SDK for Services nuget package. The telemetry package is installed along with Application Insights but must be removed separately.
In my experience the telemetry package is not required if you wish to keep using Application Insights' other features. Removing the telemetry package will stop all telemetry logging but Application Insights will continue to report non-telemetry information just fine.
I would prefer to do this:
UnInstall-Package Microsoft.ApplicationInsights.Web -RemoveDependencies
If you use the NuGet Package Manager for the solution (Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution) you can search for ApplicationInsights and uninstall the package, and there is an option to remove dependencies. There may be several. This is the easiest way to cleanup ALL the dependencies, not just some.
With a new ASP.Net Core 1.1 project:
Remove the Microsoft.ApplicationInsights.AspNetCore nuget package
Remove inject Microsoft.ApplicationInsights.AspNetCore.JavaScriptSnippet JavaScriptSnippet from the _Layout.cshtml page
Remove #Html.Raw(JavaScriptSnippet.FullScript) from _Layout.cshtml
Remove .UseApplicationInsights()from program.cs
I solved this by first uninstalling all Application Insight packages from (Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution)
Then ran
Uninstall-Package Microsoft.AspNet.TelemetryCorrelation -Version 1.0.0 -RemoveDependencies
in the Nuget console.
That fixed it for me.

Resources