Xamarin Studio 6.0 was released last week and it includes a lot of new features, such as a new dark theme and Roslyn integration. This release also includes some improvements made to the NuGet support.
- Support NuGet packages targeting tvOS.
- Support updating pre-release NuGet packages.
- Show updates available for pre-release NuGet packages.
- Remember Show pre-release Packages setting in Add Packages dialog.
- Error dialog displayed if NuGet.Config file cannot be read.
More information on all the changes in Xamarin Studio 6.0 can be found in the release notes.
Support NuGet packages targeting watchOS
A new Xamarin.WatchOS target framework is now supported which allows NuGet packages to contain assemblies for watchOS.
Support updating pre-release NuGet packages
Previously it was not possible to update a pre-release NuGet package to a later pre-release from the Solution window, only updates to stable NuGet packages were supported. The only way to update to a later pre-release NuGet package was to use the Add Packages dialog.
Now an individual pre-release NuGet package can be updated by right clicking and selecting Update. When all packages in a project or solution are updated then pre-release NuGet packages will be updated to a later pre-release version if they are available.
Show updates available for pre-release NuGet packages
Previously Xamarin Studio would only show stable NuGet package updates as being available if a pre-release NuGet package was installed. Now Xamarin Studio will check for updates for pre-release NuGet packages as well as stable packages and display this information in the Solution window.
Only if an installed NuGet package is a pre-release version will pre-release updates be shown as available in the Solution window. Xamarin Studio will not check for pre-release updates for stable NuGet package versions that are installed.
Remember Show pre-release Packages setting in Add Packages dialog
The Show pre-release Packages check box setting will now be remembered in the Add Packages dialog on a per solution basis.
Error dialog displayed if the NuGet.Config file cannot be read
Previously if the NuGet.Config file could not be read the error wouldbe silently logged, but not reported, and Xamarin Studio wouldthen switch to using the default official NuGet package source. Now an errordialog is shown indicating that there was a problem reading theNuGet.Config file.
Support NuGet packages that use icons from local files
A NuGet package can now use an icon, which will be shown in the Add Packagesdialog, taken from the local file system using a file url. Previously this would fail with an invalid cast exception.
Incorrect update count displayed after updating NuGet packages.
When an update caused a NuGet package to be uninstalled the Packagesfolder in the Solution window would show an incorrect count for the available updates.
NuGet restore and update not working for workspaces
With a workspace opened, or multiple solutions opened in Xamarin Studio, then restoring and updating NuGet packages would only work for one of the solutions.
Unable to add Google Play Services packages
The Xamarin.Android.Support.v7.AppCompat NuGet package depends ona single version of the Xamarin.Android.Support.v4 NuGet package.When a Xamarin Google Play Services NuGet package is installedthat depends on a higher version of the Xamarin.Android.Support.v4NuGet package the install would fail to find a version of theAppCompat NuGet package that is compatible. An error similar to thefollowing would be displayed in the Package Console window:
Could not add Xamarin.GooglePlayServices.Ads.Updating 'Xamarin.Android.Support.v4 188.8.131.52' to'Xamarin.Android.Support.v4 184.108.40.206' failed. Unable to find a versionof 'Xamarin.Android.Support.v7.AppCompat' that is compatible with'Xamarin.Android.Support.v4 220.127.116.11'.
The problem was that the AppCompat NuGet package is not involvedin the initial NuGet package resolution using the remote packagesource so it is initially not considered for installation into thepackages directory. When a package reference is then added to thepackages.config file a search for a compatible AppCompat package wasonly using the local solution’s packages directory which fails causingthe install to fail.
To fix this the local solution packages directory is used firstwhen looking for a compatible AppCompat NuGet package and willfallback to using the configured remote package sources if no suitable packageis found in this directory. To handle a package being added to thepackages.config at this point, after the original NuGet packages havealready been downloaded to the solution’s packages directory, Xamarin Studio will detect a package is added to the packages.config file and install the NuGet package if it is notalready in the local solution packages directory.
Incorrect package version being installed
When installing a NuGet package using the Google Play Services dialog a package version is not specified by the dialog. If the NuGet package being installed was found in the local machine’s NuGet cache it would be used instead of the latest version from the official NuGet gallery at nuget.org. This could result in a lower version being installed than expected.