March 1st, 2017

.NET Standard Libraries in Xamarin Studio

James Montemagno
Principal Manager, Tech PM

Xamarin projects have supported .NET Standard Libraries in both Xamarin Studio and Visual Studio since their original release in order to enable developers to share code more easily. Consuming .NET Standard NuGets and Assemblies is completely seamless, and with Xamarin Studio 6.2, developers can create and open .NET Standard projects.

What is .NET Standard?

The .NET Standard Library is a formal specification of .NET APIs that are intended to be available on all .NET run-times. 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 run-time that supports .NET Standard Platform.

Creating a .NET Standard Library

Similar to Visual Studio, developers can create a new or open an existing Portable Class Library. Then simply change the Target Framework navigation in the Build > General section in the project properties.

When we set the target to .NET Standard, Xamarin Studio will automatically add a project.json file or convert an existing packages.config to a project.json with all NuGet packages referenced.

Project.json Improvements

Projects with project.json package manifests are handled seamlessly in Xamarin Studio. When a project.json file is added to a project, NuGet will pick it up without having to reload the solution. Additionally, packages will automatically be restored (i.e. updating project.lock.json) when the project.json file is saved.

Learn More

To learn more about .NET Standard Libraries, head over to the .NET Standard documentation. Also, be sure to read our earlier blog on .NET Standard support for Xamarin applications.

Author

James Montemagno
Principal Manager, Tech PM

James Montemagno is a Principal Lead Program Manager for Developer Community at Microsoft. He has been a .NET developer since 2005, working in a wide range of industries including game development, printer software, and web services. Prior to becoming a Principal Program Manager, James was a professional mobile developer and has now been crafting apps since 2011 with Xamarin. In his spare time, he is most likely cycling around Seattle or guzzling gallons of coffee at a local coffee shop. He co-hosts the weekly development podcast Merge Conflict http://mergeconflict.fm.

0 comments

Discussion are closed.

Feedback