How to Use C# on Windows for Vibe Coding with Visual Studio

A simple guide for hobbyist programmers — install Visual Studio, get code from a web-based AI chatbot, and run it in console or WPF projects.


Part 1: Installing Visual Studio 2022 (Free Community Edition)

Step 1: Download Visual Studio Community Edition

  1. Go to visualstudio.microsoft.com/downloads
  2. Under “Free Community Edition,” click “Download Visual Studio”
  3. Wait for the installer (vs_community.exe) to download

Step 2: Run the Installer

  1. Double-click the downloaded installer
  2. Click “Continue” while it downloads essential files

Step 3: Select the Required Workload

When the “Workloads” screen appears, you must check at least one of these:

For Console Apps (text-based programs):

  • “.NET desktop development” (this includes everything you need)

For WPF Apps (windows with buttons, text boxes, etc.):

  • “.NET desktop development” (same workload — WPF is included)

That’s it. One workload covers both project types.

Optional but helpful:

  • “Universal Windows Platform development” – only if you want to build apps for Microsoft Store

Step 4: Install

  1. Look at the bottom-right corner to see what will be installed
  2. Click “Install”
  3. Wait 10–30 minutes (depends on your internet speed)

Step 5: First Launch

  1. After installation, launch Visual Studio from the Start menu
  2. Sign in with a Microsoft account (optional – click “Not now, maybe later” to skip)
  3. In “Development Settings,” select “Visual C#”
  4. Choose a color theme (Dark theme is popular)
  5. Click “Start Visual Studio”

Part 2: Getting Code from Your Web-Based AI Chatbot

You’ll use a chatbot in your browser (ChatGPT, Claude, DeepSeek, etc.) – not an AI built into Visual Studio.

Step 1: Ask the AI for C# Code

In your chatbot, type something like:

“Write a C# console app that asks for my name and age, then calculates what year I was born.”

Or for a windowed app:

“Write a C# WPF app with a button and a text box. When I click the button, it shows a message saying ‘Hello World’.”

Step 2: Copy the AI’s Response

The AI will give you code in a formatted box. Click the “Copy” button or select the code and press Ctrl+C.

Step 3: Important – Tell the AI Your .NET Version

For best results, add this to your prompt:

“I’m using .NET 8.0” (or .NET 9.0 if you installed the newest version)


Part 3: Two Project Types – Console vs. WPF

Project TypeWhat It DoesBest For
Console AppText-only. Runs in a black command window.Simple tools, learning, testing ideas, math calculators
WPF AppGraphical window with buttons, text boxes, lists, images.Real desktop apps, games, tools with visual interfaces

You can’t paste WPF code into a Console project (and vice versa). Always create the correct project type first.


Part 4: Creating a Console App Project

Step 1: Create New Project

  1. Open Visual Studio
  2. On the start window, click “Create a new project”
  3. In the search box, type Console App
  4. Select “Console App (.NET)” – NOT “.NET Framework”
  5. Click “Next”

Step 2: Configure the Project

  • Project name: MyConsoleVibe (or anything you like)
  • Location: C:\Users\YourName\Source\Repos\ (default is fine)
  • Click “Next”

Step 3: Select .NET Version

  • Choose .NET 8.0 (Long Term Support – most stable) or .NET 9.0 (newest)
  • Click “Create”

Step 4: Replace the Auto-Generated Code with AI Code

Visual Studio creates a file called Program.cs with starter code.

  1. In the editor, select all the existing code (Ctrl+A)
  2. Press Delete to remove it
  3. Paste your AI-generated code (Ctrl+V)

Step 5: Run Your Code

  • Press F5 (runs with debugging)
  • Or press Ctrl + F5 (runs without debugging – window stays open)

The console window opens and your program runs.


Part 5: Creating a WPF App Project (Graphical Windows)

Step 1: Create New Project

  1. Open Visual Studio
  2. Click “Create a new project”
  3. In the search box, type WPF App
  4. Select “WPF App (.NET)” – NOT “.NET Framework”
  5. Click “Next”

Step 2: Configure the Project

  • Project name: MyWPFVibe
  • Location: C:\Users\YourName\Source\Repos\
  • Click “Next”

Step 3: Select .NET Version

  • Choose .NET 8.0 or .NET 9.0
  • Click “Create”

Step 4: Understand the Two Files

WPF projects have two main files:

FileWhat It ContainsHow to Edit
MainWindow.xamlThe visual layout (buttons, text boxes, etc.)Double-click to open designer
MainWindow.xaml.csThe C# code that makes things happenRight-click → View Code

Step 5: Replace Code with AI-Generated Code

For the XAML file (visual layout):

  1. In Solution Explorer (right side), double-click MainWindow.xaml
  2. Select all (Ctrl+A) and delete
  3. Paste your AI-generated XAML code (Ctrl+V)

For the C# code file (behavior):

  1. In Solution Explorer, click the arrow next to MainWindow.xaml to expand
  2. Right-click MainWindow.xaml.cs and select “View Code”
  3. Select all (Ctrl+A) and delete
  4. Paste your AI-generated C# code (Ctrl+V)

Step 6: Run Your WPF App

  • Press F5
  • Your window appears with all the buttons and features the AI created

Part 6: Building Your Project (Compiling)

Building turns your code into an .exe file that can run without Visual Studio.

How to Build

  • Press Ctrl + Shift + B
  • Or go to the top menu: Build → Build Solution

Check for Errors

  • Look at the Output window at the bottom
  • If you see “Build succeeded” in green – you’re good
  • If you see red error messages – your AI code has issues. Paste the error back to the chatbot and ask for a fix.

Part 7: Publishing Your Project (Creating a Standalone .exe)

Publishing creates a folder with your .exe file that you can:

  • Run by double-clicking
  • Send to a friend
  • Put on your desktop

For Console Apps

  1. In Solution Explorer, right-click your project name
  2. Select “Publish”
  3. Click “Add a publish profile”
  4. Choose “Folder” as the target
  5. Pick a location (e.g., Desktop\MyApp)
  6. Click “Create”
  7. Click “Publish”

Your .exe file is now in the folder you specified.

For WPF Apps

Same exact steps – WPF publishes the same way.

Publishing Options Explained

SettingWhat It Does
FolderCreates a folder with your .exe and required files
Self-containedIncludes everything needed – runs on any Windows PC
Framework-dependentSmaller file, but user must have .NET installed

For beginners: Just accept the defaults. Click Publish.

Where to Find Your Published .exe

Look in:

  • The folder you chose during publishing
  • Or check: YourProjectFolder\bin\Release\net8.0\publish\

Inside that folder, double-click the .exe file with your project name.


Part 8: Common Vibe Coding Workflow Summary

┌────────────────────────────────────────────────────────┐
│ │
│ 1. Open your AI chatbot in a browser │
│ ↓ │
│ 2. Ask: "Write a C# console app that..." │
│ or "Write a C# WPF app that..." │
│ ↓ │
│ 3. Copy the code (Ctrl+C) │
│ ↓ │
│ 4. Open Visual Studio │
│ ↓ │
│ 5. Create new project (Console or WPF) │
│ ↓ │
│ 6. Delete default code, paste AI code (Ctrl+V) │
│ ↓ │
│ 7. Press F5 to run │
│ ↓ │
│ 8. See what happens │
│ ↓ │
│ 9. If error: paste error back to chatbot, get fix │
│ ↓ │
│ 10. Replace code with fix, run again │
│ ↓ │
│ 11. Repeat until happy │
│ ↓ │
│ 12. Build → Publish → get your .exe file │
│ │
└────────────────────────────────────────────────────────┘

Quick Reference Card

Visual Studio Shortcuts

ActionShortcut
Run (with debugging)F5
Run (without debugging)Ctrl + F5
Build (compile)Ctrl + Shift + B
Save all filesCtrl + Shift + S

Project Types – When to Use Which

Ask yourselfChoose
“Do I need buttons, images, or text boxes?”WPF App
“Is this just math or text processing?”Console App
“I want a real program with a window”WPF App
“I’m just learning or testing an idea”Console App

Publishing in One Line

Right-click project → Publish → Folder → Publish

Your .exe is ready to use.


Troubleshooting

ProblemWhat to Do
“I pasted WPF code into a Console project”Create a new WPF project instead
“I pasted Console code into a WPF project”Create a new Console project instead
“Red squiggly lines under my code”The AI gave you code for a different .NET version. Tell the AI “I’m using .NET 8.0”
“Build failed”Copy the error message (red text in Output window) and paste to your chatbot
“The window closes immediately”You’re running a Console app. Use Ctrl+F5 instead of F5
“I can’t find my .exe”Check: YourProjectFolder\bin\Release\net8.0\publish\

Final Advice

Start with Console apps. They’re simpler. Once you’re comfortable, try WPF.

Always tell the AI what project type you’re using. Say: “Write a C# console app…” or “Write a C# WPF app…”

Don’t memorize C# syntax. Let the AI write the code. Your job is to have ideas, paste, and press F5.

Save your working code. When something runs correctly, save the project and maybe copy the code to a text file. You’ll reuse it later.

Now go vibe: Open your chatbot, ask for a simple console app, create the project in Visual Studio, paste, and press F5. 🚀