How to update Xamarin.Forms to latest version? - xamarin

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

Related

How can I add WebView2 control in Visual Studio Toolbar?

In Visual Studio 2019, using Nuget, I have installed Microsoft.Web.WebView2 package.
PM> Install-Package Microsoft.Web.WebView2 -Version 0.9.430
As explained on Web, I have installed new Microsoft Edge Chromium Canary version (it is important).
Now, when I open the Toolbox, I don't see any WebView2 control.
Before that, I have installed WebView control (old version that is working with old Edge browser).
After installing WebView, the control has been visible immediately in Toolbox.
But this is not the case with WebView2 control.
I have tried to add in Toolbox all controls from Microsoft.Web.WebView2 package manually.
But Visual Studio refuses to load WebView2Loader.dll found in following folder
C:\Users\bernard\.nuget\packages\microsoft.web.webview2\0.9.430\build\x86
I have also tried with DLL found in
C:\Users\bernard\.nuget\packages\microsoft.web.webview2\0.9.430\build\x64
Is there possible to install WebView2 control in Toolbox ?
If yes, how ?
I also had this problem. I followed the instructions in the Getting Started tutorial:
https://learn.microsoft.com/en-us/microsoft-edge/webview2/gettingstarted/winforms
and installed Canary Edge as well, but the controls were still not appearing. However, it is interesting that the Microsoft.Web.WebView2.WinForms references were not showing up in the References of my Windows Form project initially. They are now appearing, but it is not clear why any of the following steps were necessary after initially simply using Nuget to installing Canary and the latest version of the WebView2 control.
After reinstalling Canary, restart Windows
Clean Project
In Manage Nuget packages, reinstall the WebView2 package to a lower version (I used the prelease of the current version, 0.9.538-prerelease)
After the third step, the library references to the WebView2 control appeared in my project References for the first time, and I was able to use them in the Form Designer.
NOTE: trying to update the control to the release version on 0.9.538 caused the references to disappear from the References and the WebView2 control was no longer available to the Form Designer. Reinstalling the prerelease solved the issue, so it appears the release of 0.9.538 supports a smaller scope than its prerelease.
TL;DR: do not update to the latest version of 0.9.538, just use the 0.9.538-prerelease.
You need to make sure that you select the checkbox "include prerelease" next to the text box for searching for packages by name. Then select a version which has a prerelease label.
Even after using the prerelease version, it was not showing in my toolbox in Visual Studio 2017 Community edition 16.6.6
My solution was to do the following:
Right-click on the toolbar in Visual Studios
Select 'Choose Items...'
Click the '.NET Framework Components' tab
Click 'Browse', may have to wait for scan to finish
Navigate to '\packages\Microsoft.Web.WebView2.0.9.538-prerelease\lib\net462'
Select the correct DLL for your application type
Once the file is selected click the 'OK' button in the window
Solution copied from here:
https://developercommunity.visualstudio.com/content/problem/1112781/webview2-control-is-missing-from-toolbox.html
EDIT: According to this post you need to use Canary or Dev build of Edge or the Edge WebView2 Preview no matter what version is supposed to work according to the release notes.
The main reason people have this problem is because they have not installed the required version of Edge.
Check the release notes. For each release you see the "minimum Microsoft Edge version". For example, when you install the latest WebView2 release 0.9.579 (released 07/20/2020) it requires Edge 86.0.579.0
but the official Edge build is (on that day) 84.0.522.
So the answer is:
either update Edge to a newer version
or use an older version of Microsoft.Web.WebView2. For which you likely need to enable prereleases:
Important: Do not downgrade! Uninstall WebView2 Nuget package, restart VS, install an older version of it, to be on the safe side.
You can now do this in C#. Just tested in WinForms.
https://learn.microsoft.com/en-us/microsoft-edge/webview2/gettingstarted/winforms
You must also download the Canary version of the browser from here: https://www.microsoftedgeinsider.com/en-us/download
I initially installed version 0.9.579 assuming that the pre-release components from 0.9.538 would be included in the newer version - no such luck. It appears that the components are only in the prerelease versions at the moment - I installed 0.9.579-pre-release and got the webview2 in the toolbox
Is there possible to install WebView2 control in Toolbox ?
I am afraid that you can't get the results you want at this stage.
As this link shows that webview2 cannot support c# projects and only support C++ projects . And Microsoft will apply it on .Net projects in the future.
Also, when you find this package on NuGet Package Manager UI, you find that it is related to C++.
I hope it won't be long before I can use it on net projects.
Just tried this with webView2 v1.0.721-prerelease and it is working
After making a new winforms project and installing the webview2 nuget package, I did have to do a rebuild solution build before it showed in the toolbox

Reference hell accessing .netstandard with framework VS2019 preview

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).

How to remove sqlite.net.platform.xamarinandroid from xamarin android project

I am trying to work on sqlite related operation's on my android project but in latest android version's getting fallowing exception i.e system/lib/libsqlite.so. Most of the post suggest to remove all sqlite pcl related packages and install latest sqlite.net.xamarinandroidN package. After installing they are mentioned remove old sqlite.net.platform.xamarinandroid dll but I am unable to remove that. I have go to my project references and unselect the xamarinandroid.dll and clean and rebuild then it's dll again added to the project automatically. Most of are mentioned that after removing that old dll only the newly installed sqlite is worked. Please suggest how can I remove old sqlite. I am using sqlite.net.xamarinandroidn and sqlite.net.pcl-async packages in my project.
Right click on your project.
Click on "Manage NuGet packages"
Open the "Installed" tab.
Hover over the package you want to uninstall, then click on the red X or you can click the Uninstall button that should be displayed on the Right.
I suggest deleting all the SQLite packages, then reinstall the ones you need.
And a tip:
This is the package you want to add (I found this in assembly references):
This is what the package will look like in your projects References once added:
Then these ones you can add through the NuGet Package Manager:

NuGet Package Manager not seeing one package as already updated

I want to know how I can debug a NuGet package not properly showing as updated. In my specific case the package for jQuery.Validation is (the only one left) in the "Update" list, but hitting the update button does nothing. Here's the dialog for Managing NuGet Packages for my solution:
Hitting the "Update" button will give an additional popup:
As you can see everything seems slightly grayed out (what does that mean?). Hitting "Ok" just brings me back to the other dialog.
The main problem is that I don't know how to debug this sort of problem. I've tried doing the following:
Opening the Package Manager Console to see if it logs any trouble. No dice.
Checking the jquery.validate.min.js file, which mentions version 1.13.1, which is in fact the one mentioned in the dialog as the newest version.
Checking the packages.config file, which also mentions my solution includes version 1.13.1.
Restarting Visual Studio. No dice.
Remove the package. Re-add the package. No dice (not even after restarting Visual Studio again).
Is this just a bug in the Package Manager or the package? How can I further debug the root cause of this problem?
I'm using Visual Studio 2012, have updated the product as well as all extensions (including the NuGet package manager). The solution was originally based on an MVC 2 template, and has been updated for each major MVC release (currently up to MVC 5). Only this particular package is giving trouble, I've succesfully updated 10+ other packages just before this one.
This can happen if you have an old NuGet package left in the packages directory.
When managing packages for the solution the NuGet dialog will show updates for all packages that are in the packages directory even if they are not installed into any projects. If you manage the packages for the project on its own the NuGet dialog would not show any package updates as being available.
So the workaround is to remove the unwanted NuGet package from the packages directory.

Trouble removing package from Visual Studio 2010

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".

Resources