.NET Standard Libraries in Xamarin Studio
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.
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.
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.