Yes, Virginia, You Are Able to Vibe Code in Blazor

 

Image Generated by ChatGPT

For years, developers working with JavaScript frameworks like React and Next.js have been able to lean on AI tools like Copilot, Claude, or Cursor to rapidly spin up applications. In those ecosystems, “vibe coding” – letting the AI take a prompt and generate a surprisingly functional application – is a real and tangible experience.

But what about Blazor? Could you vibe code in a .NET environment where structure, conventions, and configuration matter far more than in lightweight JavaScript apps?

The short answer: yes, you can.

It’s not the same as working in Cursor with React, where you can drop in a one-liner prompt and have a complete working skeleton in minutes. With Blazor, you can absolutely use AI to accelerate your workflow – but you need to do some of the setup yourself. Once you’ve got that foundation, Copilot becomes a surprisingly capable “junior developer” that saves hours of coding and testing time.

Let’s walk through exactly what I mean.


The Setup

Here’s the environment I used for my vibe coding experiment:

  1. Visual Studio 2022 – Microsoft’s flagship IDE, with all the productivity features Blazor devs know and love.
  2. GitHub Copilot – The AI coding assistant embedded right in Visual Studio.
  3. Claude Sonnet 4 (Agent Mode) – Used inside Copilot as the primary driver.
  4. Blazor Server application – My target framework for this test.

Notice what’s missing: no Copilot prompt files, no scaffolding shortcuts. I wanted to see what Copilot could do inside a standard Visual Studio Blazor workflow, without preloading context.


Step One: The Manual Kickoff

Unlike React with Vite or Next.js, you can’t just throw a “create a Blazor app with login and CRUD” prompt at Copilot and expect results. Blazor still requires structure.

To start, you must manually create your project using the Visual Studio template. This gets you the right folder structure, startup code, and the framework hooks you’ll need later.

Once the project exists, you’ll need to:

  • Add authentication – If your app requires login, set this up up front. Copilot can help refine logic but won’t scaffold identity for you.
  • Install NuGet packages – Think EF Core, FluentValidation, Mapster, Telerik, or whatever you know your project will need. Doing this early gives Copilot context when generating code.
  • Add your own libraries – Shared utilities, domain models, or UI components. Again, this helps the AI know what to lean on.

At this stage, you’ve given Copilot the foundation it needs. From here on out, the fun begins.


Vibe Coding in Blazor: What Works Well

Once the base project is ready, Copilot shines. Adding new pages with straightforward functionality is surprisingly easy:

  • Login page – Provide Copilot with a short instruction in a .razor file and it will scaffold the basics of login forms, validation, and event handlers.
  • CRUD operations – Whether for customers, products, or employees, Copilot can generate data entry forms, grids, and service methods. You’ll need to review the generated code, but it’s often 80–90% correct.

Where things really impressed me was with more complex workflows. One example stands out.


The Excel Upload Example

I asked Copilot to build a feature that would:

  1. Upload an Excel file.
  2. Parse the file into records.
  3. Save the data into a database.

Copilot handled this surprisingly well. It generated an upload form, read the file into memory, and suggested using a popular Excel parsing library (ClosedXML). It scaffolded the service methods to map data into my EF Core context and persist it.

Cool, right?

But then I took it further:

“Make this page run on the client side using WebAssembly, and update another server-rendered page with the uploaded and parsed data.”

To my surprise, it got it right the first time. The WebAssembly page handled the upload, and the server-side Blazor page refreshed with the new data. No tweaks required. That’s when I realized: this is vibe coding, Blazor-style.


The Junior Developer Analogy

The best way to think about Copilot in Blazor is as a junior developer on your team:

  • It gets 85% of the way there. Most of the time, Copilot produces functional, correct code that compiles and runs.
  • You still need to review. Like a junior dev, it won’t always follow best practices, handle edge cases, or align with your coding standards.
  • Testing is on you. Copilot won’t run your app or unit tests. You need to validate its output.

If you’re willing to explain what you want in detail, review its work carefully, and add polish, Copilot saves enormous time.


Where Copilot Excels in Blazor

  • UI scaffolding: Razor pages, forms, and simple validation.
  • CRUD operations: Generating EF Core methods and service calls.
  • Integration code: Uploads, file parsing, and data binding.
  • Refactoring helpers: Suggesting cleaner syntax, LINQ queries, or async patterns.
  • Debugging: When you paste in an error and ask for a fix, Copilot often suggests exactly what’s wrong.

Where It Falls Short

  • High-level scaffolding: Don’t expect Copilot to generate a full enterprise Blazor app from scratch.
  • Authentication & Identity: Still too complex to fully automate reliably.
  • Architecture choices: Copilot doesn’t enforce patterns like Vertical Slice, Clean Architecture, or CQRS. That’s on you.
  • Coding standards: Without prompt files or reference samples, its style may not match your team’s conventions.

Making Copilot Even Better

I deliberately tested without prompt files, sample code, or coding standards. Adding these would likely raise Copilot’s accuracy beyond 85%. With a clear .editorconfig, coding guidelines, and reference snippets, you can train Copilot to align with your preferred architecture.

Pairing it with tools like Claude in Agent Mode also helps when you want to reason about architecture, design trade-offs, or when Copilot’s context window is too short.


The Big Question: Can a Beginner Use It?

Here’s the honest answer:

  • In JavaScript ecosystems like React, yes. A complete beginner can use Copilot, Cursor, or Claude to spin up a non-trivial app.
  • In Blazor, no. Copilot doesn’t replace knowing the .NET framework, C#, and the Blazor lifecycle. You need a working understanding of the ecosystem.

And that’s okay.

Copilot doesn’t lower the bar for entry-level Blazor development – it raises the ceiling for experienced devs who already know what they’re doing.


Conclusion

Vibe coding in Blazor is real. It’s not as effortless as in JavaScript frameworks, but with the right setup, GitHub Copilot becomes a powerful productivity multiplier.

By handling repetitive scaffolding, suggesting clean patterns, and generating 85% of the code you’d normally write by hand, Copilot frees you up to focus on architecture, quality, and business logic.

Can someone who knows nothing about Blazor use it to build a non-trivial app? No. But for experienced Blazor developers, it makes you faster, more consistent, and more productive – easily 10x compared to traditional coding.

Vibe coding isn’t a silver bullet, but it’s a powerful new tool in your Blazor toolbox. And yes Virginia, you are able to vibe code in Blazor.

 

Comments

Popular posts from this blog

Yes, Blazor Server can scale!

Offline-First Strategy with Blazor PWAs: A Complete Guide 🚀

Customizing PWA Manifest and Icons for a Polished User Experience 🚀