Thread: dotnet new
View Single Post
  #3 (permalink)  
Old January 22nd, 2018, 10:46 AM
ChristianNagel ChristianNagel is offline
Wrox Author
Points: 1,163, Level: 13
Points: 1,163, Level: 13 Points: 1,163, Level: 13 Points: 1,163, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Sep 2010
Location: Austria
Posts: 175
Thanks: 3
Thanked 53 Times in 53 Posts

Originally Posted by MattSA View Post
I am working in chapter 1 of this book. Under the heading 'Building the Application' (on page 19) it suggests entering the following command:

>dotnet new

to create three files - Program.cs, NuGet.config, and project.json files. However, when I enter this command it just presents a help scenario. From this information, I was able to use the following commands:

>dotnet new console // Creates the Program.cs file
>dotnet new nugetconfig // Creates a nugget.config file
>dotnet new globaljson // Creates a global.json file

However, none of the files created are linked or produce the output discussed after the dotnet new instruction.

Can someone identify the correct statement to produce the three files at once?

The project files changed with the release of the SDK and Visual Studio 2017. You can download the two additional chapters with changes on the project files, and with updates for C# 7.0:

Also, see changes here:

With .NET Core 1.0, a console app was created using "dotnet new". With 2.0, you need a "dotnet new console".

I hope this helps.
CN innovation
Visit my blog at:
Follow me on twitter: @christiannagel
Reply With Quote