मुख्य सामग्री पर जाएँ
Skillpedia
वेबसाइट और UI (frontend)5.8k · #14565

create-blazor-project

यह क्या करती है

यह स्किल नया Blazor web application बनाती है और आपको उसका interactivity स्तर चुनने में मदद करती है। यह नई Blazor साइट या ऐप शुरू करने वाले .NET डेवलपर के लिए है।

कब इस्तेमाल करें

  • ✓जब आप नया Blazor web app शुरू करना चाहें।
  • ✓जब आपको static, server और WebAssembly interactivity के बीच चुनना हो।
  • ✓जब आप सही विकल्पों के साथ नया प्रोजेक्ट scaffold करवाना चाहें।

Skill का लिंक

https://github.com/dotnet/skills/blob/main/plugins/dotnet-blazor/skills/create-blazor-project/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/dotnet/skills/blob/main/plugins/dotnet-blazor/skills/create-blazor-project/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरे उत्पाद कैटलॉग के लिए search और कार्ट वाला नया Blazor web app बनाइए, सबसे सरल उपयुक्त interactivity के साथ।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट ऐप के फ़ीचर और interactivity ज़रूरतें पूछता है, फिर सबसे सरल उपयुक्त render mode चुनता है, और मेल खाते विकल्पों के साथ प्रोजेक्ट बनाता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Create a Blazor Web App

Before You Start — Gather Requirements

If the user's request doesn't make the following clear, ask before scaffolding:

  1. What does the app do? List the main screens/features (e.g., "product catalog with search and shopping cart").
  2. What kind of interactivity is needed? Displaying data and forms? Real-time updates? Offline support? Rich drag-and-drop UI?
  3. Deployment environment? Internet-facing? Intranet? Mobile users on slow connections?
  4. Authentication needed? Anonymous? Individual accounts? Organizational (Azure AD)?

Pick the Right Interactivity Level

Blazor render modes are a progression scale. Start at the simplest level that satisfies the requirements and only move up when there's a concrete reason.

Static SSR ──→ SSR + Enhanced Nav ──→ Interactive Server ──→ Interactive WebAssembly
 simplest                                                           most complex

Decision Rules

If the app needs... Use Why
Display data, simple forms, links between pages Static SSR (-int None) No JS runtime, no circuit, no WebAssembly download. Forms work via HTML POST. Enhanced navigation makes it feel snappy.
Everything above + a few components with client-side behavior (live search, real-time updates, complex form wizards) Interactive Server, per-page (-int Server) Only the components that need interactivity opt in with @rendermode. The rest stays static. Server-side execution, full .NET access, no API layer needed.
Most pages need rich interactivity (dashboards, drag-and-drop, chat) Interactive Server, global (-int Server -ai) Every component is interactive by default. Consistent UX, simpler mental model. Trade-off: every user holds a SignalR circuit on the server.
Network latency is a problem, users are on mobile/poor connections, or the app must work offline Interactive WebAssembly (-int WebAssembly) Code runs in the browser. Eliminates round-trip latency but requires a .Client project, API layer for data access, and downloads the .NET runtime to the browser on first visit. For offline support, enable PWA: add a service worker and manifest after scaffolding (not included in the template by default).
Fast initial load (Server) + low latency after (WebAssembly) Interactive Auto (-int Auto) First visit uses Server; subsequent visits use cached WebAssembly runtime. Most complex setup — see Auto constraints below. Only choose when both Server and WebAssembly constraints apply.

Default recommendation: Start with -int Server (per-page). It covers the vast majority of apps. Upgrade to global or WebAssembly only when a specific requirement demands it.

Auto Mode Constraints

Auto mode means your component code runs on the server first, then in the browser on subsequent visits. This creates real constraints:

  • All interactive components must live in the .Client project — same as WebAssembly.
  • No direct server access from interactive components — no EF DbContext, no file system, no server-only services. All data access must go through HTTP APIs.
  • Both Program.cs files must register matching services — the server and client DI containers must both provide implementations for any service an interactive component injects.
  • Code must not assume its execution environment — no HttpContext access, no browser-only APIs without RendererInfo guards.
  • Test in both modes — a component that works on Server during development may break on WebAssembly in production (second visit). Test both paths.

Don'ts

  • Don't pick WebAssembly "because it's cool" — it adds a .Client project, forces API-mediated data access, and downloads ~10MB to the browser on first visit.
  • Don't pick Auto unless you can articulate why Server alone and WebAssembly alone are both insufficient.
  • Don't pick global interactivity for apps where most pages are read-only content — per-page keeps the static pages fast and reduces server memory.

Scaffold the Project

Static SSR Only (display data + simple forms)

dotnet new blazor -o {AppName} -int None

No interactive runtime. Enhanced navigation enabled by default via blazor.web.js.

Interactive Server, Per-Page (recommended default)

dotnet new blazor -o {AppName} -int Server

Pages are static by default. Add @rendermode InteractiveServer to components that need interactivi

अक्सर पूछे जाने वाले सवाल

कौन से interactivity विकल्प हैं?

Static server rendering, interactive server, interactive WebAssembly और auto mode।

क्या यह सबसे सरल विकल्प से शुरू करती है?

हाँ। यह सबसे सरल स्तर से शुरू करती है और तभी ऊपर जाती है जब स्पष्ट कारण हो।

क्या यह मौजूदा प्रोजेक्ट में फ़ीचर जोड़ती है?

नहीं। यह नए प्रोजेक्ट बनाने के लिए है, मौजूदा प्रोजेक्ट का काम दूसरी जगह संभाला जाता है।

जानकारी

लेखक का मूल विवरण

Create a new ASP.NET Core web application or web site using Blazor. USE FOR: creating a new Blazor web app, scaffolding a new web project, starting a new web site, choosing render modes (Static SSR, Interactive Server, Interactive WebAssembly, Auto), running dotnet new blazor with the right options, setting up initial project structure. DO NOT USE FOR: adding features to existing projects, changing how an existing app renders, or component authoring (use author-component).

repo: dotnet/skills

लोकप्रियता

GitHub स्टार
5.8k
रैंकिंग में स्थान
#14565
लाइसेंस
MIT
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills