|
| 1 | +# Package Description |
| 2 | + |
| 3 | +ElectronNET.Core consists of three specialized NuGet packages designed for different development scenarios and project architectures. |
| 4 | + |
| 5 | +## 📦 Package Overview |
| 6 | + |
| 7 | +### ElectronNET.Core (Main Package) |
| 8 | +**Primary package for Electron.NET applications** |
| 9 | + |
| 10 | +- **Build system integration** - MSBuild targets and tasks for Electron |
| 11 | +- **Project system extensions** - Visual Studio designer integration |
| 12 | +- **Runtime orchestration** - Process lifecycle management |
| 13 | +- **Automatic configuration** - Generates electron-builder.json and package.json |
| 14 | +- **Includes ElectronNET.Core.Api** as a dependency |
| 15 | + |
| 16 | +**When to use:** |
| 17 | +- Main application projects (startup projects) |
| 18 | +- Projects that need full Electron.NET functionality |
| 19 | +- Applications requiring build-time Electron configuration |
| 20 | + |
| 21 | +### ElectronNET.Core.Api (API Package) |
| 22 | +**Pure API definitions without build integration** |
| 23 | + |
| 24 | +- **Electron API wrappers** - Complete Electron API surface |
| 25 | +- **Type definitions** - Full TypeScript-style IntelliSense |
| 26 | +- **No build dependencies** - Clean API-only package |
| 27 | +- **Multi-platform support** - Windows, macOS, Linux |
| 28 | + |
| 29 | +**When to use:** |
| 30 | +- Class library projects that interact with Electron APIs |
| 31 | +- Projects that only need API access without build integration |
| 32 | +- Multi-project solutions where only the startup project needs build integration |
| 33 | + |
| 34 | +### ElectronNET.Core.AspNet (ASP.NET Integration) |
| 35 | +**ASP.NET-specific runtime components** |
| 36 | + |
| 37 | +- **ASP.NET middleware** - UseElectron() extension methods |
| 38 | +- **WebHost integration** - Seamless ASP.NET + Electron hosting |
| 39 | +- **Hot Reload support** - Enhanced debugging experience |
| 40 | +- **Web-specific optimizations** - ASP.NET tailored performance |
| 41 | + |
| 42 | +**When to use:** |
| 43 | +- ASP.NET Core projects building Electron applications |
| 44 | +- Applications requiring web server functionality |
| 45 | +- Projects using MVC, Razor Pages, or Blazor |
| 46 | + |
| 47 | +## 🏗 Architecture Benefits |
| 48 | + |
| 49 | +### Separation of Concerns |
| 50 | +- **Build logic separate from API** - Cleaner dependency management |
| 51 | +- **Optional ASP.NET integration** - Use only what you need |
| 52 | +- **Multi-project friendly** - Share APIs across projects without build conflicts |
| 53 | + |
| 54 | +### Project Scenarios |
| 55 | + |
| 56 | +**Single Project (ASP.NET):** |
| 57 | +```xml |
| 58 | +<ItemGroup> |
| 59 | + <PackageReference Include="ElectronNET.Core" Version="1.0.0" /> |
| 60 | + <PackageReference Include="ElectronNET.Core.AspNet" Version="1.0.0" /> |
| 61 | +</ItemGroup> |
| 62 | +``` |
| 63 | + |
| 64 | +**Single Project (Console):** |
| 65 | +```xml |
| 66 | +<ItemGroup> |
| 67 | + <PackageReference Include="ElectronNET.Core" Version="1.0.0" /> |
| 68 | +</ItemGroup> |
| 69 | +``` |
| 70 | + |
| 71 | +**Multi-Project Solution:** |
| 72 | +```xml |
| 73 | +<!-- Startup project --> |
| 74 | +<ItemGroup> |
| 75 | + <PackageReference Include="ElectronNET.Core" Version="1.0.0" /> |
| 76 | + <PackageReference Include="ElectronNET.Core.AspNet" Version="1.0.0" /> |
| 77 | +</ItemGroup> |
| 78 | + |
| 79 | +<!-- Class library projects --> |
| 80 | +<ItemGroup> |
| 81 | + <PackageReference Include="ElectronNET.Core.Api" Version="1.0.0" /> |
| 82 | +</ItemGroup> |
| 83 | +``` |
| 84 | + |
| 85 | +## 🔗 Dependency Chain |
| 86 | + |
| 87 | +``` |
| 88 | +ElectronNET.Core.AspNet |
| 89 | + ↓ |
| 90 | +ElectronNET.Core → ElectronNET.Core.Api |
| 91 | +``` |
| 92 | + |
| 93 | +- **ElectronNET.Core.AspNet** depends on ElectronNET.Core |
| 94 | +- **ElectronNET.Core** depends on ElectronNET.Core.Api |
| 95 | +- **ElectronNET.Core.Api** has no dependencies |
| 96 | + |
| 97 | +## 💡 Recommendations |
| 98 | + |
| 99 | +✅ **Start with ElectronNET.Core** for new projects |
| 100 | +✅ **Add ElectronNET.Core.AspNet** only for ASP.NET applications |
| 101 | +✅ **Use ElectronNET.Core.Api** for class libraries and API-only scenarios |
| 102 | +✅ **Multi-project solutions** benefit from the modular architecture |
0 commit comments