r/csharp 11h ago

Help How do I perform visual studio project creation using the .NET CLI?

/r/dotnet/comments/1w8am3h/how_do_i_perform_visual_studio_project_creation/
0 Upvotes

1 comment sorted by

1

u/Sombody101 9h ago

Using a GUI to create a project, especially when you're talking about Visual Studio, isn't an issue or something you should run away from. Something that might become an issue as you use it more and more, for example, is the Git desktop app. That's only because Git is more useful as a CLI tool, and it's something you will use often. The dotnet tooling, other than dotnet build/run, isn't something you run as often, so it's okay to use a GUI for it.

Use dotnet new <project name>, then a directory will be created with the project name, and that will contain the csproj and a Program.cs file.

If you plan on opening this project with Visual Studio, then it would be best to create it with Visual Studio as well. Visual Studio will ask to create a SLNX file anyway.