A Visual Studio Code extension that helps developers easily create and manage ASP.NET Core MVC views, similar to Visual Studio's built-in functionality.
Features
🎯 Right-click Controller Method → Generate View
Smart Detection: Automatically detects controller and action names from your cursor position
Template Selection: Choose from Empty, Index, Create, Edit, Delete, or Details templates
Model Integration: Specify @model type and layout usage
Auto-placement: Generates .cshtml files in the correct Views/{Controller} folder
🔧 CRUD View Scaffolding
Bulk Generation: Create all CRUD views (Index, Create, Edit, Details, Delete) at once
Model-based: Generate views based on your model type
Consistent Structure: Uses standardized templates for consistent UI
📁 Default MVC Templates
Quick Setup: Generate essential MVC files with one command:
_ViewStart.cshtml
_ViewImports.cshtml
_Layout.cshtml
Shared/Error.cshtml
Project-aware: Automatically uses your project name in templates
✨ Razor Snippets
Comprehensive snippets for common Razor syntax:
@model - Model directive
@inject - Dependency injection
@Html.EditorFor - Form editors
foreach - Razor loops
if/ifelse - Conditional rendering
form - Tag helper forms
section - View sections
And many more!
🔍 Navigation Helpers
Go to Model Definition: Right-click on @model directive to jump to model class
Smart Search: Automatically finds and opens the corresponding model file
Usage
Generate View from Controller
Open a C# controller file
Position cursor on or near an action method
Right-click and select "Generate View"
Choose template type and model options
The view will be created in Views/{ControllerName}/{ActionName}.cshtml
Scaffold CRUD Views
Right-click on any folder in Explorer
Select "Scaffold CRUD Views"
Enter model type (e.g., MyApp.Models.Product)
Enter controller name
All CRUD views will be generated
Generate Default Templates
Right-click on project folder in Explorer
Select "Generate Default MVC Templates"
Essential MVC files will be created in Views folder
Using Snippets
Open any .cshtml file
Type snippet prefix (e.g., @model, foreach, form)
Press Tab to expand snippet
Navigate through placeholders with Tab
Navigation
Open a .cshtml file with @model directive
Position cursor on model type
Right-click and select "Go to Model Definition"
Model file will open at class declaration
Available Templates
View Templates
Empty: Basic view with optional model and layout
Index: List view with table layout for displaying collections
Create: Form for creating new entities
Edit: Form for editing existing entities
Details: Read-only view for displaying entity details
Delete: Confirmation view for delete operations
Default Templates
_ViewStart.cshtml: Sets default layout for all views
_ViewImports.cshtml: Global using statements and tag helpers
_Layout.cshtml: Bootstrap-based layout with navigation
Error.cshtml: Error page with development/production modes
Requirements
Visual Studio Code 1.104.0 or higher
ASP.NET Core project (detected by .csproj files)
C# extension (recommended for full functionality)
Extension Commands
ASP.NET Core: Generate View - Generate single view from controller
ASP.NET Core: Scaffold CRUD Views - Generate all CRUD views