Saturday, July 21, 2018

What are class library projects in Visual Studio 2017?

In Visual Studio Community 2017 you come across a number of templates of type, class library as shown here only for C# and F#.


ClassLibraryCom2017_0

Well, is there a need for so many of them? Visual Studio 2017 is targeting many more platforms and it is nice to have templates for each of them. Actually templates are the best starting points for any development.

The project folder and the code for the Class Library .NET Core is shown here. It can be used for projects for several platforms where .NET core is supported. Review the dependencies.


The project folder and the code for the Class Library .NET Standard is shown here. The dependency is on .NET Standard Library.


The project folder and the code for the Class Library .NET Framework is shown here. You create .dll with this template.



With the development of projects for the Universal Windows Platform, a class library project that targets UWP is also available in Visual Studio Community 2017 (free).

However there is one detail that needs to be taken into consideration as to which version of Windows platform should be used.

In this present case the following version is chosen.




The template folder and code for the Class Library for creating applications for UWP is as shown. Note the reference to the Microsoft.NETCore.UniversalWindowsPlatform


In addition to the above there are many more template types summarized here for other specific platforms:

Class Library (Android) Creates Xamarin.Android class library

Bindings Library(Android) Xamarin.Android class library that binds to Java jar.

Class Library (watchOS) Xamarin.WatchOS library 

Class Library (tvOS)  Unified library project for tvOS

Class Library (iOS) creates a Xamarin.iOS library project for iOS

Class Library(U-SQL Application) is of type Azure Data Lake, a project for creating class library(.dll) that can run on U-SQL.

Class Library(Legacy Portable) is discontinued. It is suggested to use Class Library .NET Standard.





No comments: