Robert Young
Robert Young

Reputation: 563

How can I choose a Visual C# class template in Visual Studio 2019?

I am trying to commence building an ASP.NET web application with Visual Studio 2019. I have VS Community installed with 'ASP.NET and web development' and '.NET desktop development' packages installed. The following is a screenshot of my 'Workloads' tab:

enter image description here

After installing I selected Create a New Project and selected 'ASP.NET Web Application'.

With the project and the folder tree displaying in the solution explorer (right hand side), I left clicked on 'Controller' folder and selected New -> Class. I wanted to select a Class template for Visual C# but instead can only see Visual Basic options listed. How can I source a Visual C# class template, and is there an installation step that I might have missed along the way?

enter image description here

Thanks,

Robert

London, UK

Upvotes: 0

Views: 727

Answers (2)

granadaCoder
granadaCoder

Reputation: 27872

Ultimately, pay special attention to the template, as they somewhat can overlap.

I'm drawn arrows and circles around the key points.

The below is what shows up when you do a New Project.

There are filters like "Language" and "Platforms" and "Project Types" that may be filtering out your desired. Pick "All, All, All" to make sure this is not happening.

enter image description here

enter image description here

Upvotes: 2

Jawad
Jawad

Reputation: 11364

If you are trying to create a C# project, make sure you select the correct project template.

You can create a asp.net web application with either c# (which gives you .cs files) or visual Basic (that works with .vb files).

various c# projects including visual basic

Make sure to select the correct c# template.

Upvotes: 2

Related Questions