Welcome to the course and discussion!

I just thought I’d stick a note in here to make sure passers-by knew I’m keeping an eye on this discussion area!

I hope you have a chance to work through some (hopefully all!) of the Coding for Non-Coders lessons. I’m going to be checking in here daily to ensure I’m able to quickly address issues or answer questions anyone may have.

Thank you!

Jim

I did the first Helloworld exercise. it was simple enough. I do have a question or maybe 2. First I didn’t have to create the program.cs file that has the code. It was generated automatically. Is that something that was just downloaded and generated automatically with .net install? The second question is that I didn’t have to do the dotnet build command, but when I did the dotnet run command it took a bit of time to run the first time. Is that because it built it automatically because it was never built before?

Thanks,

Hi Peggy!

“Program.cs” is created when you run the command “dotnet new console”. It’s not part of the .NET install, it’s from the command line you ran.

You’re right about “dotnet run” automatically doing the build first! “dotnet run” will check to see if any dependencies have changed before actually running the project. That means a build will automatically run if there’s been changes to the code, the project file, linked libraries, or a number of other conditions.

Good catch!

I hope you’re finding the course useful. Thank you for posting your questions!

Jim

Hi Jim!

In Lesson 4 - Section for Working W/ Projects

When you were creating a new project in Visual Studio, how did the system know that you wanted to create the HelloWorld.cs when all you had created was the HelloWorld folder under L4 file? ~approx 20:22 in the lesson

Hi Margo!

Lesson 4 at that time shows this screen:

There’s a HelloWorld.csproj file, which is a project file. That project file is created automatically when you use any form of the ‘dotnet new’ command. The project file is something Visual Studio and .NET use to track information about libraries, code files, settings, etc. It’s not something you will (most likely) ever have to deal with.

That’s different than a .cs file, like the Program.cs. The .cs files are C# (csharp) and are the software code files.

Did this answer your question?

Thanks for taking the course. I hope you’re finding it helpful!

Jim

Jim,

Thanks for the explanation! That makes much more sense!

1 Like