The namespace RDotNet could not be found - c#

I'm trying to use R with C#. I'm using Unity and MonoDevelop on the C# side and I've R version 3.2.1. I've tried my best to follow instructions here: http://jmp75.github.io/rdotnet/getting_started/
But I'm stuck. Here's what I've done
download nuget.exe, put it in a folder already in PATH.
open CMD.exe
run nuget install R.NET.Community
If I try to reinstall R.NET.Community with the same command above, I got the message that it is already installed (which is good I guess).
My question : what now? I tried to run the RDotNet namespace, but it's not recognized. Obviously I need to set up something else, but I do not know where and what. Any lead would be appreciated!

I wouldn't expect just running the nuget install to add a reference into your project - the nuget installer is basically just downloading the package for you.
You could manually add a reference in your project to the relevant assembly file (.dll) that has been downloaded. However, it would be better to use a package manager within MonoDevelop. If you're using MonoDevelop 3.x or 4.5, you should use the NuGet MonoDevelop add-in and use that to manage the NuGet packages for your project. MonoDevelop 5.x has a NuGet package manager built in, apparently.

Related

How do I install Newtonsoft.json for Visual Studio 2010?

I am trying to make Newtonsoft.json available for use in my local Visual Studio 2010 projects. I installed NuGet.Tools on my system. Now I see an item in the Solution Explorer called Service References that wasn't there before, but I don't understand how to use that to reference the Newtonsoft package I also downloaded, which is currently in my Downloads folder. Do I need to move the package to a different location to reference it?
Thanks for your help.
You can right click on the project where you want to install newtonsoft nuget package.
You will find an option "Manage NuGet packages".
Then search online for "newtonsoft".
This would add a packages.config file in your project (depending on which framework you are targeting to ).
this new file contains all the nuget dependencies required for this project.
Refer this blog for more details
VS2010 is old and is unable to update to the latest NuGet version. This means that adding recent packages will often fail; however, you can often add an older version of a package that has a compatible NuGet version and it will work. This causes the suggested answer by #ManojChoudhari to fail for me. In the case of Newtonsoft.Json, the following worked using the Package Manager Console:
Install-Package Newtonsoft.Json -Version 9.0.1

SQLite in WPF application

I'm trying to use a SQLite database file inside my WPF application.
I tried searching for a proper library that wraps the entire SQLite library.
I found the following SQLite library which allows a perfect functionality that suites me.
The problem is building it.
I tried adding it in a Visual Studio as a project and compile it to get a dll file.
That didn't work so much well because of dependencies missing inside the project and sub-projects.
If anyone anticipated or experienced any hard time with this library, I would really use the help and of course appreciate it alot.
Thanks heads up :)
You should install it as a nuget package. Right click on your project -> Manage Nuget Packages -> find SQLite.Net-PCL. You don't need source code for this, only released package and that is exactly what nuget will download for you and add as a dependency.
You can also install the package with Visual Studio's Package Manager Console:
Install-Package SQLite.Net-PCL
If you want to have source code, this library is contained inside a single file, so you can just copy SQLite.cs to your project and it will work.

Cannot find Math.net in References after installing package with NuGet in Visual Studio 2015

I'm trying to use the Math.net extension for Visual Studio 2015 with C#.
Unfortunately, after installing the package with
PM> Install-Package MathNet.Numerics -Version 3.20.0
I cannot find it anywhere in the Add References menu. I searched Assemblies->Framework and Assemblies->Extensions and COM, but it's not there
I wouldn't mind the just adding the DLL to my project, but I cannot find the DLL anywhere on https://numerics.mathdotnet.com , all the links take me to the NuGet package manager.
Also, do I need to distribute the MathNet dll with my application if I add it through the package manager, or does it build internally with the application?
Sorry, new to .net library management
I see that when I ran the command line, it added a packages folder to my project folder. Which has a few different versions of the library per .net version. Which I could browse to with Add Reference->Browse->Browse
Is this the correct way about adding a third party library?

XDocument NuGet Package won't install

In my application I'm trying to read XML files and was attempting to use the System.Xml.Linq utilities. I'm using the .net framework 4.6.1 and trying to install the System.Xml.XDocument NuGet package for that purpose.
When I try to install it from the Package Manager, it seems to install correctly (gains the checkmark in the browse tab of manager), but when I check the installed packages, it doesn't show up. I go back to browse on the package manager and it is back to not being installed in my project. I tried installing via the console, but got this error:
Error finding repository for 'https://www.nuget.org/api/v2/curated-feeds/microsoftdotnet/': An error occurred while retrieving package metadata for 'System.Xml.XDocument.4.3.0' from source 'Microsoft and .NET'.
A task was canceled.
So I downloaded the NuGet Package from NuGet.org and dumped it in a folder on my computer, tried installing it from there and it seemed to work, the console no longer producing errors, but I was still getting the same behavior in the Package Manager.
I've deleted my project.json.lock file and done a dotnet restore command a few times while trying to figure this out, but I've hit something of a brickwall in what I can do to get this package installed and usable.
In the meantime I've installed and am using the System.Xml.XmlDocument NuGet Package, so at the very least I know I can install other packages.
After working with the member of my team who knows far more about NuGet Packages than I, he pointed it out to me that System.Xml.XDocument isn't supported while using the .Net 4.6.1 Framework. The correct Package to use is/was System.Xml.XPath.XDocument.
Would have been nice to have some indication of that in Package Manager instead of the installed package just uninstalling itself, but That is going to be a marker for me to look for that in the future.

Nuget Packages not working correctly in Visual Studio

I am writing a Windows Phone app, at the beggining using VS 2010 Express for windows phone. Then I installed VS 2012 and i made a desktop app which consumed JSON/REST service using RestSharp. Due to lack of support for plugins in Express version, i got full VS 2010 Ultimate and installed Nuget. When I create a win phone library project, and i add a RestSharp package, it shows in References, but i cannot access any of it's classes (and using RestSharp is underlined in red color). Also, when i Remove it and add again from Add Reference i get an Incompatible reference error window:
RestSharp.WindowsPhone, Version=103.2.0.0, Culture=neutral, PublicKeyToken=null" is incompatible with
Windows Phone 7.1
In order to add it yourself you should to change the project's terget to a compatible framework first.
It also appears if i change the target to WP 7.0.
Has anyone solved similar problem?
In my case this was because there was a packages.config file in the project folder but not in the solution. This was why I could not add the reference again properly. Delete this file from the physical disk, and re-run your Install-Package command. It should add this correctly now.
Are you using source control?
The it might be possible that you have not yet set the solution to enable package restore (NuGet documentation).
Right click on the Solution node in Solution Explorer and select
Enable NuGet Package Restore.
After that Solution Explorer will contain a few items more and there will be a new folder packages that was automatically added to your solution folder. You will need this folder to add to your version control because it will contain your installed NuGet packages.
That's it.
If you want to know more, here's more details on what it (automatically) does for you:
It added a solution folder named .nuget containing NuGet.exe and a
NuGet.targets MsBuild file. It also changed every project in the
solution to import the NuGet.targets MsBuild task.
With this in place, any time a project is compiled, the build task
will look at each project's packages.config file and for each package
in that file, ensure that the corresponding package exists within the
packages folder. For any missing package, the build task will download
and unpack the package.
In the restore scenario, NuGet will grab the exact version when
restoring a package. It will not perform any upgrades.
Additionally, if you have the latest NuGet version installed, will now find a new option unter Tools -> Options... -> Package Manager -> General -> Allow NuGet to download missing packages during build that I would also suggest to use.
The name says it all. If the solution is configured to use a certain NuGet package but the package is not yet installed on your development machine, NuGet will download it automatically for you when you do your next build.

Categories

Resources