.NET Development Workflow
Project Layout
code
WinContextMenuEditor/
├── WinContextMenuEditor.sln
└── src/WinContextMenuEditor/
├── WinContextMenuEditor.csproj (.NET 8, WPF, UseWPF=true)
├── app.manifest (requireAdministrator)
├── Models/
├── ViewModels/
├── Views/
├── Services/
├── Converters/
└── Resources/
Build & Run
bash
# Build dotnet build # Run (requires admin - UAC prompt will appear) dotnet run --project src/WinContextMenuEditor # Publish self-contained dotnet publish src/WinContextMenuEditor -c Release -r win-x64 --self-contained
Adding New Files
Follow existing namespace conventions:
- •Models:
namespace WinContextMenuEditor.Models; - •ViewModels:
namespace WinContextMenuEditor.ViewModels;- inheritViewModelBase - •Views:
namespace WinContextMenuEditor.Views;- XAML + code-behind - •Services:
namespace WinContextMenuEditor.Services;- interface + implementation pair - •Converters:
namespace WinContextMenuEditor.Converters;- implementIValueConverter
Use file-scoped namespaces. Use nullable reference types. Target .NET 8.
Common Build Errors
- •MC3024 property already set: XAML element has both attribute and element syntax for same property. Remove one.
- •NETSDK1031 platform mismatch: Ensure
net8.0-windowstarget framework. - •Missing WPF types: Verify
<UseWPF>true</UseWPF>in csproj.