Creating the Project

We have enough of a database to get started, so fire up Visual Studio and create a new Windows Forms App under Visual C#.

What should we call it? I know! QuickBooks. Oh, wait… that’s taken. FastBooks? SpeedyBooks? I wound up calling it just plain TheBooks. My project now looks like this:

This is all default, except I resized the form so it would fit within the cropped image. And let’s go right ahead and save it. When I installed Visual Studio, it created \source\repos under some path on my C: drive. But my C: drive is an SSD of limited capacity, so I moved the folder to my D: drive, which is a spinning drive with lots of room.

There is no other folder under source, just repos. I know this is related to source control, which I don’t use and which we won’t use, and I know I could save the project anywhere, but I’m so over fighting defaults. If that’s where Visual Studio wants to put it, fine with me. But I do make sure the box is checked to put the solution in its own folder. We wind up with a folder structure like this:

The file TheBooks.sln is a plain text file with the solution’s settings. You do not ordinarily open it directly, though I have rescued corrupt projects by hacking it. What did I have to lose? The hidden folder .vs is obviously something about Visual Studio. It’s not actually needed if you move or copy the solution. When you recompile the solution, Visual Studio will recreate this hidden folder if it doesn’t fine it.

It maybe seem that the folder TheBooks is duplicated, but one if the project folder, and the other is the solution folder. I was confused about this for a while. Basically, a solution is a container for projects, and a project is something that compiles down to an .EXE or a .DLL. Projects within a solution can reference each other, and one project can depend on another. This allows you, for example, to create several related applications launched from a common toolbar.

Returning to the folder structure, you can see there is a bin and an obj folder. These terms go way back before Visual Studio. The obj folder holds the object code, which is code the compiler produces on its way to making a finished product. The bin folder holds the binary code, which is the finished product. When you debug an application, the compiler inserts additional code that allows debugging. This additional code is neither needed nor desirable once you release your application to your users, so the compiler does not include it when you compile to release. Visual Studio keeps each in separate Debug and Release folders.

The Properties folder obviously holds the project’s properties. There are no solution properties, just project properties. If you download NuGet packages, you will find a packages folder (lower case) here as well.

Leave a Reply

Your email address will not be published. Required fields are marked *