News

Xamarin Supports .NET Standard Libraries

Support for .NET Standard Libraries means Xamarin apps can share code among other .NET platforms, including .NET Core and ASP.NET Core.

Xamarin now has support for the new .NET Standard Libraries, which means Xamarin can now be used to share code among more .NET platforms, including .NET Core and ASP.NET Core.

Xamarin, which was acquired by Microsoft earlier this year, is a popular suite of tools for creating cross-platform mobile apps with one codebase written in Visual C#.

The .NET Standard Libraries can be thought of as in improved Portable Class Library, according to a blog post from James Montemagno. They specify APIs that can be used on all .NET runtimes, thus any .NET Standard Library will support any runtime that supports .NET Standard Platform.

"The .NET Standard Library is a formal specification of .NET APIs that are intended to be available on all .NET runtimes," wrote Montemagno. "You can think of it as a simplified, yet expanded, Portable Class Library. It is a single library with a uniform API for all .NET Platforms including .NET Core. You just create a single .NET Standard Library and use it from any runtime that supports .NET Standard Platform."

Microsoft said the .NET Standard Library enables the following scenarios:

  • Defines uniform set of BCL APIs for all .NET platforms to implement, independent of workload.
  • Enables developers to produce portable libraries that are usable across .NET runtimes, using this same set of APIs.
  • Reduces and hopefully eliminates conditional compilation of shared source due to .NET APIs, only for OS APIs.

The new functionality works in the Xamarin Studio IDE (today updated to version 6.0.2 to support that functionality) and in Visual Studio 2015, provided the latter has Update 3 installed and is updated to include Xamarin 4.1.2.

While the announcement heralds the ability to consume and compile the .NET Standard Libraries in the updated Xamarin Studio 6.0.2, "The ability to create .NET Standard Libraries in Xamarin Studio on macOS will be available in the future," Montemagno said.

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

  • Creating Reactive Applications in .NET

    In modern applications, data is being retrieved in asynchronous, real-time streams, as traditional pull requests where the clients asks for data from the server are becoming a thing of the past.

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

Subscribe on YouTube