Matt Ward: NuGet Support in Xamarin Studio 6.0

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.

Add Packages Dialog - Dark Theme

New Features

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

Pre-release NuGet package updates in 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 would
be silently logged, but not reported, and Xamarin Studio would
then switch to using the default official NuGet package source. Now an error
dialog is shown indicating that there was a problem reading the
NuGet.Config file.

Bug Fixes

Support NuGet packages that use icons from local files

A NuGet package can now use an icon, which will be shown in the Add Packages
dialog, 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 Packages
folder 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 on
a single version of the Xamarin.Android.Support.v4 NuGet package.
When a Xamarin Google Play Services NuGet package is installed
that depends on a higher version of the Xamarin.Android.Support.v4
NuGet package the install would fail to find a version of the
AppCompat NuGet package that is compatible. An error similar to the
following would be displayed in the Package Console window:

Could not add Xamarin.GooglePlayServices.Ads.
Updating 'Xamarin.Android.Support.v4 23.1.1.0' to
'Xamarin.Android.Support.v4 23.1.1.1' failed. Unable to find a version
of 'Xamarin.Android.Support.v7.AppCompat' that is compatible with
'Xamarin.Android.Support.v4 23.1.1.1'.

The problem was that the AppCompat NuGet package is not involved
in the initial NuGet package resolution using the remote package
source so it is initially not considered for installation into the
packages directory. When a package reference is then added to the
packages.config file a search for a compatible AppCompat package was
only using the local solution’s packages directory which fails causing
the install to fail.

To fix this the local solution packages directory is used first
when looking for a compatible AppCompat NuGet package and will
fallback to using the configured remote package sources if no suitable package
is found in this directory. To handle a package being added to the
packages.config at this point, after the original NuGet packages have
already 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 not
already 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.

Xamarin: Mobile Leaders Summit Recording | Mobile Security 2.0

In April we held Xamarin’s first ever Mobile Leaders Summit at Xamarin Evolve 2016, where mobility leaders from global organizations, top analysts, and industry experts convened to learn and share best practices around enterprise mobility and achieving business success through mobile transformation. We released the first session on creating delight in enterprise applications by Big Medium’s […]

The post Mobile Leaders Summit Recording | Mobile Security 2.0 appeared first on Xamarin Blog.

Xamarin: Become a Xamarin Studio Expert

Yesterday, we released Xamarin Studio 6, full of fantastic new features to help you work more productively. IDEs by their very nature can be complex and it’s often difficult to discover and remember the features that will help you the most, so I’d like to share some tips to help make your development experience in […]

The post Become a Xamarin Studio Expert appeared first on Xamarin Blog.

Xamarin: 30-Day Xamarin University Trial: Now with Self-Guided Learning

We’re excited to share that Xamarin University Self-Guided Learning is now included with our 30-day Xamarin University trial! Our collection of Self-Guided courses cover the same content as our live courses, but are designed to be consumed at your own pace. The free 30-day Xamarin University trial already included access to our Lightning Lectures, Guest […]

The post 30-Day Xamarin University Trial: Now with Self-Guided Learning appeared first on Xamarin Blog.

Xamarin: Live from dotNetConf: Cycle 7, Xamarin Studio 6, and more

In my talk at dotNetConf happening right now, I announced the next stable release of the Xamarin Platform. This includes updates for both our Apple and Google SDKs as well as our IDE support. In-depth details can be found in the release notes: Xamarin Studio 6.0 Xamarin for Visual Studio 4.1 Xamarin.iOS 9.8 Xamarin.Android 6.1 Xamarin.Mac 2.8 Mono 4.4.0 Xamarin Studio 6 […]

The post Live from dotNetConf: Cycle 7, Xamarin Studio 6, and more appeared first on Xamarin Blog.

Xamarin: RSVP for the Xamarin + Microsoft WWDC 2016 Party

Join Xamarin + Microsoft on Monday, June 13 from 5:00 pm–8:30 pm after the WWDC 2016 State of the Union in the Twitter building just behind the Bill Graham Civic Auditorium to grab food, get a drink, and chat about iOS. Simply check in at the door and you’ll be entered into our draw to […]

The post RSVP for the Xamarin + Microsoft WWDC 2016 Party appeared first on Xamarin Blog.

Xamarin: Live Webinar: Create Native iOS and Android Apps with Visual Studio and Xamarin

Xamarin and Microsoft empower developers to become native cross-platform iOS, Android, and Windows mobile app developers. Leverage the powerful C# language features and .NET libraries to share code across all platforms and create a shared mobile app backend, and build a beautiful user interface utilizing the iOS and Android designers right from inside Visual Studio. […]

The post Live Webinar: Create Native iOS and Android Apps with Visual Studio and Xamarin appeared first on Xamarin Blog.

Matt Ward: ASP.NET Core 1.0 RC2 support in Xamarin Studio

Xamarin Studio and MonoDevelop now have support for ASP.NET Core 1.0 RC2 with an alpha release of the .NET Core addin.

ASP.NET Core web project in Solution window

This is an update of the original DNX addin which adds support for .NET Core RC2 and also, thanks to David Karlas, adds support for debugging .NET Core applications on the Mac.

Features

  • Debugging .NET Core applications with the .NET Core CLR on Mac.
  • Project templates for console, library and web applications
  • Code completion
  • NuGet integration
  • Solution window integration

Supports

Installing .NET Core SDK

The .NET Core SDK needs to be installed separately before using the .NET Core addin. Detailed installation instructions can be found on Microsoft’s .NET Core web site.

Installing the addin

The addin is currently available from MonoDevelop’s Add-in Repository in the alpha channel. In Xamarin Studio open the Add-in Manager and select the Gallery tab. Click the repository drop down and if Xamarin Studio Add-in Repository (Alpha Channel) is not displayed then click Manage Repositories. In the window that opens tick the check box next to Xamarin Studio Add-in Repository (Alpha Channel) and then click the Close button.

.NET Core addin selected in Addin Manager dialog

Select the .NET Core addin and then click the Install button.

After installing the .NET Core addin you will need to restart Xamarin Studio before the project templates are available in the New Project dialog.

Creating a .NET Core project

There are three project templates available for .NET Core in the New Project dialog.

New ASP.NET 5 project templates

Debugging

Thanks to David Karlas there is a support for debugging .NET Core applications when running on the .NET Core CLR if you have the VSCode Debugger addin installed.

Debugging a .NET Core application

The VSCode Debugger addin is currently available from MonoDevelop’s Add-in Repository on the alpha channel.

Debugging .NET Core console and web projects that target the full .NET framework is supported on all platforms. The .NET Core command line tool (dotnet.exe) will create an executable when targeting the full .NET Framework which can be debugged in Xamarin Studio. On Windows the x86 version of the .NET Core SDK needs be installed since Xamarin Studio currently cannot debug x64 applications on Windows.

Source Code

The source code for the addin is available on GitHub.