Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create .Net 5.0 Class Library project in Visual Studio 2019 16.8.1?

I can not see the Class Library(.NET) option on Add a New Project window in Visual Studio 16.8.1. How can I create a Class Library (.NET) project? (Not .Net Core or .Net Framework)

like image 453
Tolga Cakir Avatar asked Nov 17 '20 11:11

Tolga Cakir


1 Answers

In Visual Studio 2019, I believe it needs to be 16.8+, you can enable the preview feature Show all .NET Core templates in the New project dialog.

enter image description here

Go Tools -> Options -> Environment -> Preview Features -> Show all .NET Core templates in the New project dialog (Requires Restart)

Then close Visual Studio and reopen it. Now from the new project dialog there should be a Class Library with a C# in the tags.

enter image description here

From here, click Next. Fill out where you want it to be made and what to call it as you normally would.

enter image description here

Then click Next again. This will bring you to a new screen that has a drop down for the Target Framework.

enter image description here

Set this to .NET 5.0 and click Create. This creates a .NET 5.0 class library and opens it in the IDE.

like image 169
Dan Avatar answered Sep 19 '22 23:09

Dan