Skip to main content

01. Visual Studio Setup and Essentials

Level: Beginner

ℹ️ What You'll Learn
  • Download and install Visual Studio Community free
  • Configure for .NET and ASP.NET development
  • Create your first Console or Web project
  • Navigate solution structure and file organization
  • Essential extensions and settings
  • Set up SMS (School Management System) project

Download and Install

Visual Studio Community is free for personal, student, and open-source use. It's the IDE most .NET developers use daily.

Visit: https://visualstudio.microsoft.com/downloads/

Choose: Visual Studio Community (latest version)

Installation Steps

  1. Download installer (small ~5MB)
  2. Run installer
  3. Select ".NET desktop development" workload
  4. Choose install location
  5. Click Install (20-30 minutes)
✓ .NET desktop development
✓ ASP.NET and web development
✓ Azure development

First Project

Create Console App for School Management:

  1. Open Visual Studio
  2. Create Project → Console App (.NET)
  3. Name: SMS.Core
  4. Location: C:\NexCoding\Projects\
  5. Framework: .NET 8
  6. Click Create

Project structure appears:

SMS.Core/
├── Program.cs
├── SMS.Core.csproj
└── bin/obj/

Project Configuration

Open SMS.Core.csproj (right-click → Edit):

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>SMS</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>

Key settings:

  • TargetFramework: Which .NET version
  • RootNamespace: Default namespace (SMS)
  • ImplicitUsings: Auto-import common namespaces
  • Nullable: Strict null-safety

Essential Extensions

Install via Extensions → Manage Extensions:

Code Quality:

  • Prettier Code Formatter — Auto-format code
  • Visual Studio IntelliCode — AI code suggestions
  • Roslynator — Code analysis

Productivity:

  • Productivity Power Tools — File nesting, git tools
  • REST Client — Test APIs inline
  • NuGet Package Explorer — Browse packages

Testing:

  • NUnit 3 Test Adapter — Run NUnit tests
  • xUnit.net — xUnit test support

Search extensions in sidebar or use shortcut: Ctrl + Shift + X

Code Snippets - SMS Examples

Simple Student Controller Stub

Type propfull + Tab:

private string _rollNumber;
public string RollNumber
{
get { return _rollNumber; }
set { _rollNumber = value; }
}

Auto-Property (Shorthand)

Type prop + Tab:

public string Name { get; set; }

Creating Custom Snippet

File → Export Template → ItemTemplate → Choose Class

Customize and reuse for SMS entities (Student, Teacher, Exam, etc.)

IntelliSense Features

Press Ctrl + Space while typing:

// Type: Student.
// IntelliSense shows:
- RollNumber { get; set; }
- Name { get; set; }
- Status { get; set; }

Press Ctrl + Shift + Space for parameter hints.

Solution Structure for SMS

Organized project layout:

SMS/
├── SMS.Core/ # Business logic
│ ├── Models/
│ │ ├── Student.cs
│ │ ├── Teacher.cs
│ │ ├── Exam.cs
│ │ └── FeeAccount.cs
│ ├── Services/
│ │ ├── StudentService.cs
│ │ ├── ExamService.cs
│ │ └── FeeService.cs
│ └── Program.cs
├── SMS.Data/ # Database
│ ├── Context/
│ │ └── SmsDbContext.cs
│ └── Migrations/
├── SMS.Api/ # ASP.NET Core API
│ ├── Controllers/
│ │ ├── StudentsController.cs
│ │ ├── ExamsController.cs
│ │ └── FeesController.cs
│ └── Program.cs
└── SMS.sln # Solution file

Key Shortcuts

ShortcutAction
Ctrl + K, Ctrl + CComment selection
Ctrl + K, Ctrl + UUncomment selection
Ctrl + F5Run without debugging
F5Run with debugging
Ctrl + Shift + BBuild solution
Ctrl + .Quick actions & refactoring
Alt + EnterShow suggested fixes

Debugging Essentials

Set breakpoint: Click left margin or F9

Watch variables:

  • Debug → Windows → Watch
  • Type variable name: student.RollNumber
  • See value during execution

Step through code:

  • F10 — Step over (execute line)
  • F11 — Step into (enter function)
  • Shift + F11 — Step out (exit function)

NuGet Package Management

Install packages for SMS:

  1. Tools → NuGet Package Manager → Package Manager Console
  2. Command: Install-Package Dapper

Or right-click project → Manage NuGet Packages → Browse

Common SMS packages:

  • Dapper — Micro-ORM
  • Entity Framework Core — ORM
  • Newtonsoft.Json — JSON handling
  • Serilog — Logging
  • FluentValidation — Input validation

Key Takeaways

  • Visual Studio Community = free, powerful IDE
  • Workloads = modular installation (only install what you need)
  • Projects organized by domain (Core, Data, Api)
  • IntelliSense = smart code completion
  • Debugging = essential skill (breakpoints, watch, step)
  • Extensions = productivity boosters
💡 Pro Tip

Create solution templates. Right-click project → Export Template. Reuse same structure for future SMS projects.

⚠️ Setup Issues
  1. .NET not installed — Install .NET SDK from dotnet.microsoft.com
  2. Extensions conflict — Disable conflicting extensions
  3. Slow IntelliSense — Disable unused extensions, restart VS
  4. Out of memory — Increase available RAM or close unused projects
🤖Use AI to Learn Faster

Use ChatGPT, Claude, or Copilot to go deeper on Visual Studio Setup. Try these prompts:

  • "How do I install Visual Studio Community?"
  • "What workloads do I need for .NET?"
  • "How do I debug an application?"
  • "Quiz me on Visual Studio"

💡 Tip: After reading this article, paste your own code into AI and ask "What could go wrong here and why?" — fastest way to find edge cases and deepen understanding.

nexcoding.in