Introduction to Projects
Introduction to Projects
Fundamentals of Projects
A project is a group of files and resources that are compiled to produce an application. This means that, if you want to have an application, you must create a project. You have many options.
As you may know by now, an application starts from a solution, which is a file. That solution file must be contained in a solution folder. To have a working application, a solution folder must contain a project, or at least one project. A solution must be created and managed, and then a project can be added to the solution.
Practical Learning: Creating a Solution
Adding a Project
To have an application, after creating a solution, you must create a project. Actually, you must add a project to a solution. You have many options.
One way to create or add a project is to work from a command prompt. A better option is to work from Microsoft Visual Studio. To start, in the Solution Explorer, right-click the name of the solution, position the mouse on Add, and click New Project... This action would display the Add A New Project dialog box.
We were previously introduced to the Create A New Project dialog box. You may remember that it displays if the user clicks Create A New Project from the Start Window. The Add A New Project dialog box has the same design as the Create A New Project dialog box.
Microsoft Visual Studio supports various types of applications, meaning many types of projects. To assist you with some details on projects, Microsoft Visual Studio provides template projects. Some of the templates you can use are for:
As you can see, you can create more than fitty types of applications using Microsoft Visual Studio. To specify the type of application you want to create (in the Create A New Project dialog box) or to specify the type of project you want to add to your solution (in the Add A New Project dialog box), you can click it in the right list. Because that list box can be long, as an alternative, you can first select the desired language in the Languages combo box. Then, in the right list, you can click the desired template application.
Practical Learning: Creating a Project
Console.WriteLine("=====================================================================================================");
Console.WriteLine(" Eastern Properties Rentals");
Console.WriteLine("-----------------------------------------------------------------------------------------------------");
Console.WriteLine(" Altair Estates");
Console.WriteLine("=====================================================================================================");
Console.WriteLine("Prop # | Property Type | Address | City | State | ZIP-Code | Beds | Baths");
Console.WriteLine("=======|===============|========================|===============|=========|==========|======|========");
Console.WriteLine("770686 | Single Family | 4288 Lucow Drive | Rockville | MD | 20856 | 5 | 3.5");
Console.WriteLine("-------|---------------|------------------------|---------------|---------|----------|------|--------");
Console.WriteLine("250351 | Townhouse | 719 Beanson Road | Arlington | VA | 22201 | 4 | 3.5");
Console.WriteLine("-------|---------------|------------------------|---------------|---------|----------|------|--------");
Console.WriteLine("264649 | Condominium | 6662 16th Street NW | Washington | DC | 20012 | 1 | 1");
Console.WriteLine("-------|---------------|------------------------|---------------|---------|----------|------|--------");
Console.WriteLine("975700 | Single Family | 39 Anesta Court | Gettysburg | PA | 17325 | 3 | 2.5");
Console.WriteLine("-------|---------------|------------------------|---------------|---------|----------|------|--------");
Console.WriteLine("575370 | Condominium | 10574 Spring Floor Rd | Hinesville | GA | 31313 | 2 | 2");
Console.WriteLine("-------|---------------|------------------------|---------------|---------|----------|------|--------");
Console.WriteLine("747575 | Townhouse | 228 South Gather Str | Blanchard | OK | 73010 | 4 | 3.5");
Console.WriteLine("-------|---------------|------------------------|---------------|---------|----------|------|--------");
Console.WriteLine("375705 | Single Family | 8604 Bridge Stone Ave | Brecken Ridge | CO | 80824 | 4 | 4.5");
Console.WriteLine("-------|---------------|------------------------|---------------|---------|----------|------|--------");
Console.WriteLine("886868 | Condominium | 2644 Swanson Drive | Charleston | WV | 25301 | 3 | 2");
Console.WriteLine("-------|---------------|------------------------|---------------|---------|----------|------|--------");
Console.WriteLine("694708 | Single Family | 508 North Harrison Str | Papillion | NE | 68046 | 4 | 2.5");
Console.WriteLine("=====================================================================================================");The Recently Used Templates
On the left side, the Create A New Project and the Add A New Project dialog boxes are equipped with a label titled Recent Project Templates. If you have not worked on any solution before, below the large label is a longer label that displays "A list of your recently accessed templates will be displayed here.". If you have previously worked on at least one solution, the longer label would not display. The large label titled Recent Project Templates actually represents a list box. If you have not worked on any solution before, the left list box would be empty. If you have previously worked on at least one solution, the Recent Project Templates list box would display those types:

Searching for a Template
Both the Create A New Project and the Add New Project dialog boxes are equipped with a combo box on the right side of the top title. If you know the complete or partial name of the type of project (or solution) you want to create, type it in the top combo box. A list of possible matches would display in the right list box. Here is an example:

The Projects of a Solution
In .NET programming, a solution is referred to as a container. As a result, a solution can contain many projects. In the previous section, we saw how to add a new project to an existing solution. In the same way, you can keep adding projects to a solution. One of the advantages of a solution is that it can contain different types of projects and projects that use various or different computer languages. After adding a project, you can manage it according to its type.
Practical Learning: Adding Projects to a Solution
let firstName : string = "Emmanuel"
let lastName : string = "Reasons"
let jobTitle : string = "Accounts Manager"
let hSalary : float = 27.86
let monday : float = 9.5
let tuesday : float = 8
let wednesday : float = 10.5
let thursday : float = 9
let friday : float = 8.5
let timeWorked = monday + tuesday + wednesday + thursday + friday
let mutable regTime = timeWorked
let mutable overtime = 0.00
let mutable regPay = hSalary * timeWorked
let mutable overPay = 0.00
if timeWorked > 40.00 then
regTime <- 40.00
overtime <- timeWorked - 40.00
regPay <- hSalary * 40.00
overPay <- hSalary * 1.50 * overtime
let netPay = regPay + overPay;
printfn "===================================================="
printfn "Payroll Evaluation"
printfn "===================================================="
printfn "Employee Information"
printfn "----------------------------------------------------"
printfn "Full Name: %s %s" firstName lastName
printfn "Account Manager: %s" jobTitle
printfn "Hourly Salary: %0.2f" hSalary
printfn "===================================================="
printfn "Time Worked Summary"
printfn "--------+---------+-----------+----------+----------"
printfn " Monday | Tuesday | Wednesday | Thursday | Friday"
printfn "--------+---------+-----------+----------+----------"
printfn "%6.2f | %6.2f | %7.2f | %7.2f | %6.2f"
monday tuesday wednesday thursday friday
printfn "========+=========+===========+==========+=========="
printfn " Pay Summary"
printfn "----------------------------------------------------"
printfn " Time Pay"
printfn "----------------------------------------------------"
printfn " Regular:%8.2f %9.2f" regTime regPay
printfn "----------------------------------------------------"
printfn " Overtime:%7.2f %9.2f" overtime overPay
printfn "===================================================="
printfn " Net Pay:%18.2f" netPay
printfn "===================================================="Module Program
Sub Main(args As String())
Dim cost
Dim type
Dim make
Dim model
Dim period
Dim bookValue
Dim salvageValue
Dim estimatedLife
Dim depreciationRate
Dim yearlyDepreciation
period = 1
Console.WriteLine("Machines Depreciation")
Console.WriteLine("=======================================================================")
Console.WriteLine("Enter the required values")
Console.WriteLine("-----------------------------------------------------------------------")
Console.Write("Type of Machine: ")
type = Console.ReadLine()
Console.Write("Manufacturer: ")
make = Console.ReadLine()
Console.Write("Model: ")
model = Console.ReadLine()
Console.Write("Machine Cost: ")
cost = Console.ReadLine()
Console.Write("Salvage Value: ")
salvageValue = CDbl(Console.ReadLine())
Console.Write("Estimated Life: ")
estimatedLife = CInt(Console.ReadLine())
depreciationRate = 100.0# / estimatedLife
yearlyDepreciation = SLN(cost, salvageValue, estimatedLife)
bookValue = cost
Console.WriteLine("=======================================================================")
Console.WriteLine("Machine/Device: {0} {1} {2}", make, model, type)
Console.WriteLine("=======================================================================")
Console.WriteLine("Depreciation Schedule")
Console.WriteLine("=======================================================================")
Console.Write(" Depreciation" & vbTab & " Yearly" & vbTab & vbTab & vbTab & "Accumulated" & vbCrLf)
Console.Write("Year" & vbTab & "Rate" & vbTab & vbTab & "Depreciation" & vbTab & "Book Value " & vbTab & "Depreciation" & vbCrLf)
Console.WriteLine("=======================================================================")
Do
Console.WriteLine(" " & period & vbTab & FormatNumber(depreciationRate, 2) & "%" & vbTab & vbTab &
FormatNumber(yearlyDepreciation) & vbTab & vbTab &
FormatNumber(Format(bookValue - (yearlyDepreciation * period), "#")) & vbTab &
FormatNumber(yearlyDepreciation * period))
Console.WriteLine("-----------------------------------------------------------------------")
period = period + 1
Loop Until period = estimatedLife + 1
End Sub
End ModuleExecuting a Project
Introduction
In previous lessons, we saw how to execute a project to see its results. As a matter of fact, you can execute a project using the main menu of Microsoft Visual Studio, the Solution Explorer, or a shortcut.
Practical Learning: Executing a Project
=====================================================================================================
Eastern Properties Rentals
-----------------------------------------------------------------------------------------------------
Altair Estates
=====================================================================================================
Prop # | Property Type | Address | City | State | ZIP-Code | Beds | Baths
=======|===============|========================|===============|=========|==========|======|========
770686 | Single Family | 4288 Lucow Drive | Rockville | MD | 20856 | 5 | 3.5
-------|---------------|------------------------|---------------|---------|----------|------|--------
250351 | Townhouse | 719 Beanson Road | Arlington | VA | 22201 | 4 | 3.5
-------|---------------|------------------------|---------------|---------|----------|------|--------
264649 | Condominium | 6662 16th Street NW | Washington | DC | 20012 | 1 | 1
-------|---------------|------------------------|---------------|---------|----------|------|--------
975700 | Single Family | 39 Anesta Court | Gettysburg | PA | 17325 | 3 | 2.5
-------|---------------|------------------------|---------------|---------|----------|------|--------
575370 | Condominium | 10574 Spring Floor Rd | Hinesville | GA | 31313 | 2 | 2
-------|---------------|------------------------|---------------|---------|----------|------|--------
747575 | Townhouse | 228 South Gather Str | Blanchard | OK | 73010 | 4 | 3.5
-------|---------------|------------------------|---------------|---------|----------|------|--------
375705 | Single Family | 8604 Bridge Stone Ave | Brecken Ridge | CO | 80824 | 4 | 4.5
-------|---------------|------------------------|---------------|---------|----------|------|--------
886868 | Condominium | 2644 Swanson Drive | Charleston | WV | 25301 | 3 | 2
-------|---------------|------------------------|---------------|---------|----------|------|--------
694708 | Single Family | 508 North Harrison Str | Papillion | NE | 68046 | 4 | 2.5
=====================================================================================================
Press any key to close this window . . .
Return to your programming environmentThe Default Project of a Solution
If you have a solution that contains more than one project, one of the projects is referred to as the default project. In the Solution Explorer, the name of the default project is in bold characters. If you have a solution that contains many projects, if you simply execute the application, the default project would execute. If you want to execute another project, one solution is to designate that project as the default one.
Practical Learning: Setting the Default Project of a Solution
====================================================
Payroll Evaluation
====================================================
Employee Information
----------------------------------------------------
Full Name: Emmanuel Reasons
Account Manager: Accounts Manager
Hourly Salary: 27.86
====================================================
Time Worked Summary
--------+---------+-----------+----------+----------
Monday | Tuesday | Wednesday | Thursday | Friday
--------+---------+-----------+----------+----------
9.50 | 8.00 | 10.50 | 9.00 | 8.50
========+=========+===========+==========+==========
Pay Summary
----------------------------------------------------
Time Pay
----------------------------------------------------
Regular: 40.00 1114.40
----------------------------------------------------
Overtime: 5.50 229.84
====================================================
Net Pay: 1344.25
====================================================
Press any key to close this window . . .Executing a Specific Project
If you have a solution that contains more than one project, at any time, you can execute any project of your choice. This is done from the Solution Explorer.
Practical Learning: Executing a Specific Project
Machines Depreciation ======================================================================= Enter the required values ----------------------------------------------------------------------- Type of Machine: Business Printer Manufacturer: Xerox Model: AltaLink C8130 Machine Cost: 6500 Salvage Value: 1000 Estimated Life: 8 ======================================================================= Machine/Device: Xerox AltaLink C8130 Business Printer ======================================================================= Depreciation Schedule ======================================================================= Depreciation Yearly Accumulated Year Rate Depreciation Book Value Depreciation ======================================================================= 1 12.50% 687.50 5,813.00 687.50 ----------------------------------------------------------------------- 2 12.50% 687.50 5,125.00 1,375.00 ----------------------------------------------------------------------- 3 12.50% 687.50 4,438.00 2,062.50 ----------------------------------------------------------------------- 4 12.50% 687.50 3,750.00 2,750.00 ----------------------------------------------------------------------- 5 12.50% 687.50 3,063.00 3,437.50 ----------------------------------------------------------------------- 6 12.50% 687.50 2,375.00 4,125.00 ----------------------------------------------------------------------- 7 12.50% 687.50 1,688.00 4,812.50 ----------------------------------------------------------------------- 8 12.50% 687.50 1,000.00 5,500.00 ----------------------------------------------------------------------- Press any key to close this window . . .
Fundamental Files of Projects and Solutions
A File for a Project
When you create or add a project, Microsoft Visual Studio automatically creates an XML file for that project. If you are working on a C# project, the file has the extension "csproj". You can open that file using any text editor, including Notepad. Here is an example:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
For a Visual Basic project, the extension of the project file is "vbproj". For a C++ project, the extension is "vcxsproj". For an F# project, the extension is "fsproj". For a Python (including Flask, Django, and Bottle, which are supported in Microsoft Visual Studio) project, the extension is "pyproj". For a JavaScript-based project (React, Angular, and Vue), the extension is "esproj". By the way, the contents of the project files are different and they depend on the type of project.
The project file is a configuration file that assists the compiler. There is hardly any reason you will want to manually change the content of this document.
A File for a Solution
As seen in our introduction to solutions, remember that when you create a solution, the compiler automatically generates an XML file (".slnx") that contains a simple element named Solution. Here is an example:
<Solution />
If you add a project to a solution, if you build or execute the project, the compiler creates and adds an element for that project in the ".slnx" file. Here is an example:
<Solution>
<Project Path="EasternRentals/EasternRentals.csproj" />
</Solution>
If you create or start a project in Microsoft Visual Studio, the solution is created and a project is automatically added to the solution. In this case, an XML element for the project is automally created in the ".slnx" file.
In the same way, every time you add a project to a solution (and build or execute the solution), the compiler updates the ".slnx" file. Here is an example:
<Solution>
<Project Path="EasternRentals/EasternRentals.csproj" />
<Project Path="MachinesDepreciations/MachinesDepreciations.vbproj" Id="e13fe758-0d33-4783-9f66-19fea5cf26d6" />
<Project Path="PayrollEvaluation/PayrollEvaluation.fsproj" Id="72e69615-d5ca-479c-b158-a599082be429" />
</Solution>
Also, if you create or add a project, the compiler opens the DocumentLayout.json file and creates a child for the Documents element. That child is created for the project. That child element is made of two sub-elements named AbsoluteMoniker and RelativeMoniker respectively. That Documents-child is created for each project. This means that that Documents-child contains a combination of AbsoluteMoniker and RelativeMoniker sub-elements for each project.
Enhancing a Project
Introduction
When yoou start a project, whether using command prompt or Microsoft Visual Studio, a few files are automatically generated for you. Those files serve only as a foundation. They can be used useful as a starting point. Of course, they can be executed and produce a working application, but such an application is hardly useful to regular users since they produce only a Hello World sentence on the screen. Therefore, you usually have to enhance the project by adding files, writing codes, and performing other types of operations.
Practical Learning: Enhancing a Project


Adding a File to a Project
As mentioned already, a project starts with at least one fundamental file. In C#, that primary file is usually named Program.cs. In most cases, to have a professional application, you would add files to the projects, including code files, help files, etc. In previous lessons, we saw how to create files, sometimes by creating a class. You can also add files that use other languages: XML files, JSON files, etc. You saw that you can create a file by using the main menu (File or Project) or by right-clicking something in the Solution Explorer (the solution, a project, or a folder) and using the Add menu item.
If you start creating a file from the main menu (File or Project) or the Solution Explorer, you are expected to complete the file by writing code in the document. As an alternative, you can use a file created by someone else with code that is ready to be used. In this case, you would import an existing code. Of course, you should have the file in your computer or you should know one way or another how you would access that file.
Practical Learning: Adding Files to a Project
namespace PayrollEvaluation
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new Exercise());
}
}
}927594 429272 394131 379492 740317 503582 483794

Week 1
Monday: 8
Tuesday: 7.5
Wednesday: 6
Thursday: 7.5
Friday: 6.5
Week 2
Monday: 7
Tuesday: 8
Wednesday: 6
Thursday: 6
Friday: 8


Week 1
Monday: 8
Tuesday: 10.5
Wednesday: 9
Thursday: 8
Friday: 8.5
Week 2
Monday: 9
Tuesday: 8
Wednesday: 10
Thursday: 8
Friday: 10.5
Adding a Package
.
Fundamentals of Managing Projects and their Solution
Introduction
Like any item of a computer, a project is created and must be managed. Remember that a project belongs to a solution. Some details belong to a project only. The details of some projects are related to its solution. You should keep those aspects in mind when managing a project and its solution.
A Solution and a Starting Project
In the previous lesson, we saw how to first create a solution and then add some projects to it. In previous lessons, we saw that Microsoft Visual Studio allows you to create a solution and a starting project at the same time. The way we did it in our introductory lessons was that the solution and that starting project used the same name. This is fine if you are planning to have only one project in your solution. If you are planning to have a solution that contains more than one project, the solution should have its own name while each project also has its own name. You have many options. For example, as we did in the previous lesson, you can first create a solution and later add a project to it. Another option is to specify a name for a solution and a different name for the project in the Create A New Project dialog box.
Practical Learning: Creating a Solution and a Starting Project


Practical Learning: Ending the Lesson
Solution 1: AltairRealtors
Project 1: C# Console - EasternRentals
Project 2: F# Console - Payroll Evaluation - if timeWorked > 40.00 then
Project 3: VB Console - MachinesDepreciations - SLN
Solution 2: CollegeParkCorporation
Project 1: VC# WinForms - PayrollEvaluation - Adding Files to a Project, 3 files - if (secondWeekTotalTime < 40)
Project 2: WinForms - StellarWaterPoint - JSON Files (WaterMeters.js, Customers.js, WaterBills.js), Forms (WaterMeters.cs, Customers.cs, WaterBills.cs)
Project 3: React - PayrollEvaluation - JSON File (Employees.js)
Project 4: C# Console - StellarWaterPoint - Water Meters - NuGet Package, EF (Classes: WaterMeter, Customer, WaterBill)
Project 5: F# WinForms - CollegePartAutoParts - XML File (AutoParts.xml), F# Files (AutoPartDetails.fs, StoreInventory.fs)
|
|
|||
| Previous | Copyright © 2001-2026, FunctionX | Sunday 04 October 2026, 12:48 | Next |
|
|
|||