PackageExploreris the WPF shell;App.xaml.cscomposes MEF exports from itself andPackageViewModelso new UI services or commands must be[Export]ed to join the composition.Coreholds platform-agnostic package inspection (loading.nupkg,SymbolValidation, telemetry helpers) and feeds both desktop and CLI; favor adding heavy logic here.PackageViewModelimplements the MVVM surface and MEF extensibility (Commands/,PackageAnalyzer/,PluginManagerViewModel); desktop views bind directly to these models.Typesdefines plugin contracts (IPackageCommand,IPackageContentViewer,IPackageRule) consumed through MEF; shared XAML inPackageExplorer/NugetPackageExplorer.Views.Shared.projitemsis reused by UNO targets.dotnet-validate(CLI) andUno/NuGetPackageExplorer.WinUI.csprojreference the sameCore+PackageViewModelassemblies, so cross-cutting changes must build across WPF, WinUI, and browser WASM.
- The repo pins SDK
10.0.100-rc.2inglobal.json; keep preview features enabled (LangVersion preview,Nullable enable,AllowUnsafeBlocks true). - Standard desktop build:
dotnet build NuGetPackageExplorer.sln -c Release(outputs underartifacts/bindue toUseArtifactsOutput=true). - UNO/Web builds require workloads:
dotnet workload install wasm-tools wasm-tools-net9before publishing Uno targets. - Uno desktop publish:
dotnet publish Uno/NuGetPackageExplorer/NuGetPackageExplorer.WinUI.csproj -f net10.0-desktop -c Release. - Uno WebAssembly publish:
dotnet publish Uno/NuGetPackageExplorer/NuGetPackageExplorer.WinUI.csproj -f net10.0-browserwasm -c Release. - All builds must complete without warnings or errors; treat warning-free output as the acceptance bar.
- Azure pipelines drive packaging via
ReleaseChannel; local publishes mimic this (dotnet publish PackageExplorer/NuGetPackageExplorer.csproj /p:PublishProfile=...). - Versions flow from
version.json+ Nerdbank.GitVersioning (nbgv) and land in manifests (PackageExplorer.Package/*.appxmanifest); adjust there instead of hardcoding.
- Run
nbgv get-versionbefore packaging to confirm semantic versioning; pipeline callsnbgv cloud -c -aso keepversion.jsonin sync. - Desktop package publishes use
Properties/PublishProfiles/WinX64.pubxml; WAP builds live inPackageExplorer.Package/*.wapprojand require the Release channel to populate manifests before MSBuild. dotnet run --project dotnet-validate/dotnet-validate.csproj package local <path>exercises the CLI validator against local nupkg files;remotesubcommand pulls through NuGet feeds for regression checks.- Build artifacts collect under
artifacts/<channel>; binlogs land inartifacts/logs(match pipeline layout when reproducing MSBuild failures locally). - When testing feed interactions, seed credentials through
App.xaml.cs::InitCredentialServiceproviders; many flows depend onmachine.configand the MRU caches persisted in%APPDATA%.
Uno/NuGetPackageExplorer/NuGetPackageExplorer.WinUI.csprojis a single project targeting WASM, WinUI, and Skia; it reuses WPF XAML viaNugetPackageExplorer.Views.Shared.projitemsplusNugetPackageExplorer.Shared.Legacy.projitemsfor legacy shims.- WASM builds rely on
Platforms/WebAssemblyassets and set env keys (MSDL_PROXY_LOCATION,NPE_AI_INSTRUMENTATIONKEY,MONO_GC_PARAMS); keep these when adding scripts or telemetry. - WebAssembly debugging depends on the
UnoCORS Azure Function (Uno/Api); ensure new HTTP calls go through that proxy or are CORS-safe. - Platform feature flags come from MSBuild constants:
USE_MONACO_EDITORlights up Monaco in WASM, while Windows targets defineUSE_WINUI; guard new code with the same constants. - Uno
MefServicesinUno/NuGetPackageExplorer/MefServicesreplace WPF services; flesh outNotImplementedExceptionplaceholders or add platform conditionals before calling them from shared code.
.editorconfigenforces 4-space indentation for C# and UTF-8 BOM; keep private fields_camelCase, public APIs PascalCase, and interfaces prefixed withI.- Prefer
varfor locals, expression-bodied properties, and modern C# features (pattern matching,??=) while keeping methods/constructors block-bodied unless clarity suffers. - Nullable is enabled solution-wide; WPF constructors often wrap specific sections in warning pragmas—follow that pattern instead of disabling nullable for whole files.
- Analyzer noise is tuned:
CA2007,CA1031, and high-DPI warnings are suppressed; keep any new warning suppressions scoped tightly to match existing pragmas. - Resource strings flow through the
ResXCompositeFormatGenerator; request interpolated text from generatedCompositeFormatproperties instead ofstring.Formatliterals.
- MVVM is handwritten; view models inherit
ViewModelBase, callOnPropertyChanged, and marshal back to the UI thread with the WPF dispatcher or Uno equivalents. - MEF drives extensibility: export new services/commands with
[Export], supply metadata attributes when needed, and preferImportManycollections to stay recomposable. - Package validation rules live in
PackageViewModel/PackageAnalyzer/*Rule.cs—returnPackageIssuerecords and keep rule logic pure so the CLI and desktop share identical diagnostics. PackageViewModelFactorymaterializes dependencies lazily; follow that pattern when introducing expensive services to avoid startup regressions.- Shared services (e.g.
MefServices/*.cs) adapt UI abstractions; keep platform-specific behavior behind these facades so WPF and Uno stay aligned.
- NuGet feed access uses
NuGet.Protocolwith defaults fromCore/NuGetConstants.cs; leveragePackageChooser+INuGetPackageDownloaderwhen touching remote feeds. - Credential flow is orchestrated in
App.xaml.cs::InitCredentialService; new credential providers should exportICredentialProviderand respect the manager cache. - Symbol checks rely on
Core/SymbolValidation/SymbolValidator; keep deterministic build requirements and Source Link evaluations consistent when editing packaging logic. - Application Insights keys are injected at build time (
Build/scripts,ApplicationInsights.config); avoid checking secrets into source.
UseArtifactsOutputmeans tests or tooling looking for binaries should read fromartifacts/instead ofbin/directly.- Nightly/Store builds inject
ReleaseChannelconstants (Directory.Build.props); guard channel-specific code with the existingNIGHTLYandSTOREpreprocessor symbols. - There is minimal automated testing—manual validation paths (
PackageExplorer/MainWindow.xaml.csworkflows,dotnet-validate) are the de facto regression checks. - UNO
MefServicescurrently throwNotImplementedExceptionfor some contracts; desktop features that assume complete implementations need conditional guards. Common/CommonAssemblyInfo.csis linked into each project; update assembly metadata here rather than per-project attributes.