Hi, I'm trying to instal Nuget packagebut the following appear - visual-studio

This is the result, I tried many packages but all say the same.
I'm using Visual Studio 2019
Severity Code Description Project File Line Suppression State
Error Could not install package 'SQLitePCLRaw.core 2.0.4'. You are trying to install this package into a project that targets 'native,Version=v0.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
As I'm new in this field I don't understand what it means,
Thanks for your help

You can see that this nuget package depends on the .net which means that it is used for C# projects.
From your description, you have installed this package on a C++ project. So the error happens.
I have a small test: install this package in C++ project which proves the root cause of the issue.
Suggestion
You should create a C# project and then you can install this nuget package on that.

Related

How to include the system.data.sqlite.core.1.0.108 NUGet package in Visual Studio

I would like to be using sqlite such as I do for sqlserver, in my uses clauses:
using System.Data.Sqlite etc...
What steps should I do?
That did not solve the problem, because I do not have any reference del tipo system.data.sqlite to add. Therefore I cannot use the sqlite framework at all. All i have is the nuget package but I do not know how to install it in VS.
My Problem was to implement the usage of Sqlite in VisualStudio in one of my projects.
1)I started downloading: the system.data.sqlite.core.1.0.108 NUGet package, from here:
https://www.nuget.org/packages/System.Data.SQLite
2)But I did not know how to install it. Then someone pointed out that there is the Package Manager Console in Visual Studio and I can install by Console.
3)Following the tutorial on the same page I did this.
Notice: you must have a solution opened in the VS in order for the PM to install the package. Packages will be installed on that Application only.
4)After that you can access all the functionalities of SQLite by including it with:
Using System.Data.SQLite and System.Data.Sqlite.Generic

Nuget-package not adding package reference

I am trying to install MySql.Data and MySql.Data.Entity to my class lib.
Somehow there is no reference added to the project.
Things I've tried:
Update-Package -reinstall (does not help)
packages.config contains the correct entries
*.csproj also has the correct entries
Cleared NuGet-Cache
This is the output:
Package 'MySql.Data.6.10.6' already exists in folder
'C:\Users\MYUSERNAME\Documents\Repositories\XXXXXXX\packages'
Added package 'MySql.Data.6.10.6' to 'packages.config'
Successfully installed 'MySql.Data 6.10.6' to XXXXXXXX.Persistence
Executing nuget actions took 1,6 sec
Strange thing is that NuGet creates that \docs in my project which is part of MySql
Nuget-package not adding package reference
I agree with Matt`s comment. You project targets framework should be .NET 4.5.1 or below. Because the package MySql.Data only contain assembly reference to .NET framework 4.5.2 for .NET framework:
However, this package also have the content files, which are compatible with .net framework. So when you add this package to the project(target framework 4.5.1 or below), nuget will install this nuget package without any error, just add the content file (\docs) but not add any reference to the project.
To resolve this issue, you can change the target framework to 4.5.2 and above of this project or you should use the nuget package MySql.Data with the version 6.9.11, which contain assembly reference to .NET framework 4.0 and 4.5:
Note: If you change the target framework to the .net framework 4.5.2 and above, you may get the error "The package 'MySql.Data' tried to add a framework reference to 'System.ComponentModel' which was not found in the GAC.", please add a manually reference to missed library:
Package tried to add reference to System.Runtime which was not found in the GAC
Hope this helps.
I experienced this problem even though I had the correct Framework.
It was solved by Migrating the Nuget Format to Package References
For visual studio latest versions you have to right click on Dependencies > Manage NuGet Packages > click in the settings button with a flower-like shape, then in NuGet Package Manager option choose General, and change Default package management format from packages.config to PackageReference.
If that does not do the trick, then you will have to add the packages through the CLI tools, looking into the nuget gallery and pasting the comand directly with the desired version, like for example:
dotnet add package Microsoft.EntityFrameworkCore.Design --version 6.0.10

SQLite Assembly can't be added to project

In my Visual Studio app I get the following Build Error:
"The type 'SQLiteConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.SQLite, Version=1.0.105.2, ..."
So I went to Project -> Add Reference... and looked under "Assemblies" whether there was one called 'SQLite' that I might add.
There was none so I went to my package manager and installed the SQLite NuGet.
Then I went again to Project -> Add Reference... and looked under "Assemblies" for 'SQLite'. And again there was nothing !!!
What the hell is going on here? How can I add a reference to this damn SQLLite?
PS: When I check in the Package manager for the installed packages, SQLite is shown as being installed. But still, it doesn't show up under Project -> Add Reference ... so I can't add it.
The SQLite Nuget package has to be installed on the projects in your solution, not just installed generally. I don't know for sure what your solution looks like, but ...
If you have, say, two projects in the solution, and let's say they are a web app or a winforms app with a data access layer class library that is doing SQLite work. You will have to install the SQLite package on both the DAL and the running project. Simply highlight the project in question in the solution explorer, and then use the Nuget package manager to install the package. Then highlight the next project and do the same with it. If you only install Sqlite to the DAL library, you'll get an error saying that the interop dll can't be found. For some reason the startup project needs to have the Sqlite package installed on it, even if it isn't using it directly.
I hope this helps -- I'm new to Sqlite myself, and this may not fit your exact trouble.

Can not install Optano Modeling in Xamarin solution

I'm just starting out with Xamarin and trying to install this package 'Optano Modeling' into my Xamarin Forms solution via Nuget. But I keep getting this error when installing Optano modeling.
'Could not install package 'FParsec 1.0.1'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
'
I noticed FParsec is written in F# and my solution is in C#. Does anyone know if Optano Modeling / FParsec can be used in a Xamarin solution? Could someone point me in the right direction?
Turns out that one of the dependencies in a sub dependency (Math.NET Numerics for F#) wasn't compatible with the 'portable45-net45+win8+wpa81' configuration.

Failed to add reference to WikiNetParser. Please make sure that it is in the Global Assembly Cache

I am trying to add a reference to a project in Visual Studio 2012, by using 'Manage Nuget References'. The package is 'Wiki .NET Parser' (version 2.5.2.0).
When I try to add it, I get the below:
Successfully installed 'WikiNetParser 2.5.2.0'.
Successfully uninstalled 'WikiNetParser 2.5.2.0'.
Install failed. Rolling back...
Failed to add reference to 'WikiNetParser'. Please make sure that it is in the Global Assembly Cache.
I have also tried to create a clean, blank console project - But I still get the same problem. Any ideas?
A search on Google returned nothing specific to this component
The package appears to have a malformed manifest. I've reported this issue to the author of the package.
Specifically: The Manifest contains this node:
<frameworkAssemblies>
<frameworkAssembly assemblyName="WikiNetParser" targetFramework=".NETFramework4.0" />
</frameworkAssemblies>
Which tells NuGet to look for the "WikiNetParser" in the Core .Net 4.0 libraries, which of course does not exist. The node can simply be removed and the package should install successfully. If you want to try cracking the package open yourself, you can try using NuGet Package Explorer.

Resources