How to create a mvc project in visual studio code

Asked

Viewed 2,005 times

2

I’m starting to learn how to develop for web with c# in visual studio code.
I am trying to create a web project, the problem is that the command I am using "dotnet new MVC -the Folder Name " already creates a structure.

  • How do I create an empty mvc project in visual studio code?
  • 1

    You want to create an empty MVC project or an empty Solution with no project inside?

  • Sorry, I’m learning, have rent between the two projects.

  • Sometimes that can help you! https://answall.com/questions/232044/sugest%C3%B5es-de-comandos-no-vscode/265191#265191

  • Ps.: When you mention Visual Studio Core, it would just be a mess with the Dotnet Core Framework or would you be referring to Visual Studio Code?

  • Vscode right? And not Core, correct your post! : ) abs.

  • I’m referring to Visual studio code, because I’m using the linux operating system.

  • I’ll edit my answer

  • @Antoniolima, See the beginning of my updated reply.

  • Thanks Leandro Angelo, the explanation is similar to some site that was searched, in the not well summarized like yours, thanks helped a lot.

Show 4 more comments

1 answer

5


To add an empty ASP.Net Core project, you must open a command prompt, navigate to the directory where you want to create it and run the following command:

dotnet new web

The MVC template already includes the initial structure of this type of project, you can consult all available templates via the command (reference):

dotnet new -l

The following steps are for other versions of Visual Studio, since Visual Code does not work with standard Solutions, only directories.

To create an empty Solution via Dotnet CLI, you must open a command prompt, navigate to the directory where you want to create it and run the following command:

dotnet new sln

This command has no argument and will create a file . sln with the same name as the directory where it was executed.

Now to add projects to your Solution you can use the sln commands (reference) or follow the most practical path that create them through the visual studio.

The same can be done within the visual studio itself by accessing the menu:

File -> New Project -> Other Project Types

inserir a descrição da imagem aqui

And to add an empty web project:

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.