How do you import a library into Xamarin?
For instance, how would i import json.net into xamarin for my project?
Thanks
Json.NET is available as a nicely packaged free Xamarin-compatible Component from the Component Store. You can also install from NuGet, but it is generally more difficult to determine which NuGet packages are Xamarin (or PCL) compatible.
Go to
Project=>Add Packages..
Should see Json.NET, just check it.
What's your IDE?
if Xamarin Studio:
(your project root node) => Add Packages..., then type in the search box.
if Visual Studio:
right click on References of your project, and click Manage NuGet Packages..., then type in the search box.
In xamarin studio Go to Project -> Add Packages
Search Json.NE and added.
Adding packages is really easy. Just click the settings cog on the Xamarin Packages folder in the solution explorer to add packages.
Also I am not sure why your question was downvoted. Seems like a good one to me (Upvoted)!
Go to solution window and check your project.
Right click on component->click on "get more component" -> search for required package and Click on "Add"
thus, you can get your required package.
Related
I can get my .net standard 2.0 package working in a .net framework 4.7.2 dll if I do the following steps
In my standard project VS2019 61.4.4 right click the project and select pack to create the .nupkg
Then I set up a nuget package source for the package
In my framework project I install nuget package
I get the following dialog
I choose PackageReference in project file
I answer yes to accept licensing
Then I can see the following
And I can get my project working.
However on a different machine running VS2019 16.5.0 Preview 2.0, I do not get the dialog asking me to choose the package manager format.
Instead the references look like
and I can not get my project working.
[Update]
After following Lance's link to migrate packages.config to PackageReference
The project looks like
I was able to remove the unwanted packages by right clicking references and choosing Remove Unused References
The program worked!
Go Tools=>Nuget Package Manager =>General => Package Management You can control the behavior by Allow format selection on first package install. Enable the checkbox and restart VS, this change will take effect.
And note the dialog only appears when we install first package in current project. So if you create a new project and install package, it will appear. And since you once installed packages in that project, the dialog won't appear in WindowsFormApp2 any more.
(But you can easily migrate packages.config to PackageReference, see this).
I'm on Xamarin Studio 6.0.2 (Build 73), running on Windows. Even when I create a fresh new project, the Project Options menu entry is disabled, which means I have to edit the .csproj file in Notepad++, which is not very convenient.
Some other menu entries are also greyed out. As I said, this happens even for New projects created by Xamarin Studio.
So having looked at your version information it seems like Xamarin.Android is not installed which is why you are having this issue.
You will need to install the Xamarin.VisualStudio package. Even if you only intend to use Xamarin Studio, this is required as it includes both Xamarin.Android and Xamarin.iOS.
Please reach out to contact#xamarin.com and we can provide you with the link for this! Please add the link to this question in your email.
I'm starting to work with Xamarin.Forms for the first time. I noticed I might have an outdated version in my project though, and I can't find how to update it.
Looking at the NuGet gallery, the latest version is 1.5:
https://www.nuget.org/packages/Xamarin.Forms/
However, in my project, I'm still using version 1.3 somehow, even though I created the project only a few days ago. Here's what the solution explorer looks like:
Xamarin Studio won't let me update the references because they are "from packages". What does that mean and how can I update?
From menu click Project->Update Nuget Packages then it will check updates(can be check from status bar at top side of editor). When it finished the update checking process go to Packages from solution explorer. You'll see the (1 update notification). Right click the package and update.
It's that simple.
You can find Xamarin.Forms as a NuGet package, so you have to go under Package, not Reference, and Add Package
As for August 2019, you can go to your Forms project in Solution window, open Dependencies > NuGet and right click on Xamarin.Forms and then click Update if you want to only update Xamarin.Forms. Remember about doing it for 3 projects: *.Forms, *.Forms.Android and *.Forms.iOS.
Project->Update Nuget Packages will update everything which is not always desired
I am looking at setting up a custom NuGet repository for my organization and I would like the ability to have the package sources saved against the solution so that other developers don't need to manually set up their own package sources, is this possible?
So my problem was that in order for the .Nuget folder to be created automatic restore needs to be enabled by Right clicking on the solution in VS and choosing "Enable Nuget Package Restore" rather than relying on the visual studio option.
Yes you can, if you make use of the MSBuild based package restore functionality. Detailed steps can be found in this blog post: http://xavierdecoster.com/nuget-package-restore-using-solution-specific
I accidently added a package to my VS2010 MVC 3 project via the 'Manage NuGet Packages' tool in the 'Tools' menu and I would like to remove it, however after some research I can't seem to figure out how to do it.
I have tried opening up the 'Manage NuGet Packages' tool within the solution, but there seems to be no uninstall option so I searched online and found the following article on installing and uninstalling packages. It mentions right clicking on the project and choosing the 'Add Package Library Reference' option, but this doesn't exist. I did notice that the example's project is a Website type, where mine isn't as I am using a modified version of the MVC project template.
Anyway, I searched online again and found several mentions of starting VS2010 as an Administrator and then the option for uninstalling should be available in the 'Manage NuGet Packages' tool, however this didn't change anything and no uninstall option appears.
Can anyone suggest what might be the problem and how to remove this package?
Here's a link to the docs:
Go to the section entitled Removing a Package, you can use the console to uninstall the package you want.
From the Library Package Manager, click the Installed Packages tab, then click Manage on the package you want to remove. Clear the checkbox for the solution/project you want the package uninstalled from, then click OK.
Or, open up the Package Manager Console and type "uninstall-package YourPackageName".