简体   繁体   中英

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:

在此处输入图像描述

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?

在此处输入图像描述

Thanks,

Robert

London, UK

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).

各种 c# 项目,包括 Visual Basic

Make sure to select the correct c# template.

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.

在此处输入图像描述

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM