Visual Studio How To

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 21

Visual Studio “How To”

Last Update: Jan 8th, 2021


Version: 1.0
How To List
1. C# Console Application .Net Framework
2. Import C# class file to an existing project
3. Create a C++ Windows console app
4. ASP.Net Web Application (.Net Framework) No Authentication
1. Create a C# Windows console app
C# .NET Framework .exe
Step 1
• Select “Create a new project” option
to open the template selection window
1. Create a C# Windows console app
C# .NET Framework .exe
Step 2
• In the filter panel, select “C#” and
“Console”
• In the template list, select “Console App
(.Net Framework)”
• Click “Next”
1. Create a C# Windows console app
C# .NET Framework .exe
Step 3
• Give the project a name
• Select the location to store the whole
Solution
• Give the solution a name (or solution
name was set the same as project name
by default)
• Select a .Net Framework version
• Click on “Create”
1. Create a C# Windows console app
C# .NET Framework .exe
Step 4
• Now you should see a file, named
“Program.cs”, opened in the window
with some code.
• Before writing any code, let’s build and
run the program, the make sure the
project is correctly created.
• Select BuildBuild Solution to build
• If you see a success result in the Output
window, that means your program has
been built successfully; and a Windows
program file (.exe) is ready for you.
• You can also find the location of the .exe
file in the Output window
1. Create a C# Windows console app
C# .NET Framework .exe
Step 5
• Now you can use any one of the following two
options to run the program.
• “Start Debugging”
• “Start Without Debugging”

Step 6
• Now an empty project was successfully
created; and you are ready to program the
console app.
2. Import C# class file to an existing project
Setup:
• You have created a C# project.
• You have a C# class file from
somewhere else.
Objective:
• You want to import the C# class to
The Project
the project.

The Class File


2. Import C# class file to an existing project
Step 1 (MyBinaryTree.cs is the class file) 1.1
1.1. Copy & Paste the class file to the project folder. (You
may create a new folder for the class file, or simply under
the root folder, depend on how do you like to organize the
files)
1.2. Now you should be able to see the class file in Visual
Studio folder view
1.3. You can not see the class file in Visual Studio solution 1.2
view
1.4. You won’t be able to use the class

1.4

1.3
2. Import C# class file to an existing project
Step 2 (MyBinaryTree.cs is the class file)
2.1. In Visual Studio Solution view, right click the 2.1 & 2.2
project name to open the menu.
2.2. Select AddExisting Item
2.3. Select the target file in popup window.
2.4. You should see the new class file; and you should
be able to use the class now
2.5. Save .sln (very important)
2.4 2.3
2.4
2. Import C# class file to an existing project
What happened after we selected “AddExisting Item”
• Compare the .csproj file before and after. What changed?

Before After
3. Create a C++ Windows console app
Step 1
• Select “Create a new project” option
to open the template selection window
3. Create a C++ Windows console app
Step 2
• In the filter panel, select “C++” and
“Console”
• In the template list, select “Console App
(.Net Framework)”
• Click “Next”
3. Create a C++ Windows console app
Step 3
• Give the project a name
• Select the location to store the whole
Solution
• Give the solution a name (or solution
name was set the same as project name
by default)
• Click on “Create”
3. Create a C++ Windows console app
Step 4
• Now you should see a file, named “.cpp”,
opened in the window with some code.
• Before writing any code, let’s build and
run the program, the make sure the
project is correctly created.
• Select BuildBuild Solution to build
• If you see a success result in the Output
window, that means your program has
been built successfully; and a Windows
program file (.exe) is ready for you.
• You can also find the location of the .exe
file in the Output window
3. Create a C# Windows console app
Step 5
• Now you can use any one of the following two
options to run the program.
• “Start Debugging”
• “Start Without Debugging”

Step 6
• Now an empty project was successfully
created; and you are ready to program the
console app.
4. ASP.Net Web Application (.Net
Framework) No Authentication
Step1
• Select “Create a new project” option
to open the template selection window
4. ASP.Net Web Application (.Net
Framework) No Authentication
Step 2
• In the filter panel, select “C#” and “Web”
• In the template list, select “ASP.NET Web
Application (.Net Framework)”
• Click “Next”
4. ASP.Net Web Application (.Net
Framework) No Authentication
Step 3
• Give the project a name
• Select the location to store the whole
Solution
• Give the solution a name (or solution
name was set the same as project name
by default)
• Select a .Net Framework version
• Click on “Create”
4. ASP.Net Web Application (.Net
Framework) No Authentication
Step 4
• Select “MVC”
• Select “No Authentication”
• Click on “Create”
4. ASP.Net Web Application (.Net
Framework) No Authentication
Step 5
• From Visual Studio toolbar, Click on run
with “IIS Express”
• The project will be built and if it is
successful, a web browser will be launched
and you can see the index page of the
application.

You might also like