C# – First steps with C# and .NET – part 056.

If you install the Visual Code and start a new project, you may see this on the Program.cs file.

It is a new feature to speed your start development step.
Using the command dotnet run will work well.
This feature is enabled in your csproj file type and will include all you need to run the source code, like using System and all of these: namespace … void Main …

To disable and return to the old-style source code:

… use this in the csproj file project:

For example, the console applications come with these directives implicitly included in the application when you use this feature:

If you want to select and restrict some of these you need to add them in the csproj file project.
For example, to run a console application for using only the System and NumSharp packages with this feature enabled, you need to have this on your csproj file project:

You can read more about this feature on this webpage.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.