diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a49acfe..d7c589f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,7 +10,11 @@ updates: - "*" - package-ecosystem: "nuget" - directory: "/NtoLib" + # Repo-root scope: with Central Package Management enabled, all versions + # live in Directory.Packages.props at the repo root. Pointing dependabot + # at "/" lets it discover both NtoLib.csproj and Tests/Tests.csproj and + # update the central versions file in a single PR per group. + directory: "/" schedule: interval: "monthly" groups: diff --git a/.github/instructions/csharp.instructions.md b/.github/instructions/csharp.instructions.md index 730fce6..efee89f 100644 --- a/.github/instructions/csharp.instructions.md +++ b/.github/instructions/csharp.instructions.md @@ -13,9 +13,15 @@ COM component via `netreg.exe`. - **Framework:** .NET Framework 4.8, C# 10 (`LangVersion`), `Nullable` enabled - **Solution:** `NtoLib.sln` — two projects: `NtoLib` (main library) and `Tests` (xUnit) -- **csproj style:** Old-style with explicit `` entries (no wildcards) -- **Build:** `dotnet build` → ILRepack merges NuGet DLLs into `NtoLib.dll` (vendor SDK DLLs - in `Resources/` are excluded); `netreg.exe` registers the COM component for MasterSCADA +- **csproj style:** SDK-style (`Microsoft.NET.Sdk`) with `EnableDefaultCompileItems=false`; + every `.cs` file is listed explicitly as `` (no wildcards). Packages + are referenced via ``; versions live centrally in + `Directory.Packages.props` (Central Package Management). +- **Build:** `dotnet build` produces an un-merged `NtoLib.dll` for unit tests. Merging + is gated on `/p:RunILRepack=true` (because `[InternalsVisibleTo("Tests")]` would + otherwise cause CS0433 ambiguity in the test project) and runs only via + `Build/Package.ps1` / `Build/deploy.ps1` after the test step. `netreg.exe` registers + the merged `NtoLib.dll` as a COM component for MasterSCADA. --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae87a18..b1c5225 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,8 @@ on: - "Tests/**" - "Resources/**" - "NtoLib.sln" + - "Directory.Packages.props" + - "nuget.config" - "global.json" - ".editorconfig" - "!**.md" @@ -19,6 +21,8 @@ on: - "Tests/**" - "Resources/**" - "NtoLib.sln" + - "Directory.Packages.props" + - "nuget.config" - "global.json" - ".editorconfig" - "!**.md" @@ -45,18 +49,8 @@ jobs: with: global-json-file: global.json - - name: setup NuGet - uses: NuGet/setup-nuget@v2 - - # NtoLib.csproj uses packages.config with MSBuild of - # ..\packages\Serilog.4.3.0\build\Serilog.targets — dotnet restore does - # not populate packages/ for old-style projects, so nuget.exe restore - # runs first. dotnet restore then covers the Tests project's - # PackageReference graph. - name: restore - run: | - nuget restore NtoLib.sln - dotnet restore NtoLib.sln + run: dotnet restore NtoLib.sln - name: build run: dotnet build NtoLib.sln -c Release --no-restore diff --git a/AGENTS.md b/AGENTS.md index 6824e46..04b2ca6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,19 +6,37 @@ via `netreg.exe`. - **Framework:** .NET Framework 4.8, C# 10, Nullable enabled - **Solution:** `NtoLib.sln` — two projects: `NtoLib` (main library) and `Tests` (xUnit) -- **csproj style:** Old-style with explicit `` entries (no wildcards) +- **csproj style:** SDK-style (``) with explicit + `` entries — default item globs are disabled + (`EnableDefaultCompileItems=false`, `EnableDefaultEmbeddedResourceItems=false`, + `EnableDefaultNoneItems=false`) so the "no wildcards" rule still holds. +- **NuGet:** `PackageReference` only; versions centrally managed in + `Directory.Packages.props` at the repo root (Central Package Management). ## Build ```powershell -dotnet build NtoLib.sln -Build/Package.ps1 # build + ILRepack merge + archive -Build/Deploy.ps1 # build + merge + copy to target machine +dotnet build NtoLib.sln # un-merged DLL (used by tests) +dotnet build NtoLib.sln -p:RunILRepack=true # merged DLL (used for deployment) +Build/Package.ps1 # build + test + ILRepack merge + archive +Build/deploy.ps1 # build + merge + copy to target machine ``` +`Build/Package.ps1` orchestrates the pipeline: it runs the test suite against the +un-merged DLL, then re-builds with `-p:RunILRepack=true` to produce the merged +artifact, then archives. + ILRepack merges all NuGet DLLs into a single `NtoLib.dll`, excluding vendor SDK DLLs -(`FB.dll`, `InSAT.*`, `MasterSCADA.*`). After build, `netreg.exe NtoLib.dll /showerror` -registers the COM component for MasterSCADA. +(`FB.dll`, `InSAT.*`, `MasterSCADA.*`). The merge step is implemented in +`NtoLib/ILRepack.targets` (invoked through MSBuild via the +`ILRepack.Lib.MSBuild.Task` package); the legacy `Build/tools/Merge.ps1` PowerShell +wrapper has been removed. The target is gated on the `RunILRepack` MSBuild +property so a plain `dotnet build` produces an un-merged DLL — this is intentional +and required, because `NtoLib` carries `[InternalsVisibleTo("Tests")]` and merging +internalised NuGet types into the assembly would collide with the Tests project's +own ``s on the same packages (CS0433 ambiguity on +`FluentResults.Result<>`, `Microsoft.Extensions.*`, etc.). After the merged build, +`netreg.exe NtoLib.dll /showerror` registers the COM component for MasterSCADA. ## Test @@ -46,7 +64,7 @@ Code Cleanup or `jb cleanupcode`. NtoLib/ ├── NtoLib/ main library (FB implementations) ├── Tests/ xUnit + FluentAssertions + Moq -├── Build/ PowerShell pipeline (Package.ps1, Deploy.ps1, tools/) +├── Build/ PowerShell pipeline (Package.ps1, deploy.ps1, tools/) ├── Docs/ documentation │ ├── architecture/ primer + NtoLib patterns (LLM-targeted, not user-facing) │ ├── known_issues/ platform-level bug classes with cause and workaround @@ -72,14 +90,46 @@ for the reading order). ## csproj Conventions -- `NtoLib.csproj` uses **explicit `` entries** — no wildcards. Every new - `.cs` file must be added manually. +- `NtoLib.csproj` is **SDK-style** (``) but uses + **explicit `` entries** — no wildcards. Default item globs are + disabled via `EnableDefaultCompileItems=false`, + `EnableDefaultEmbeddedResourceItems=false`, `EnableDefaultNoneItems=false`, and + `GenerateAssemblyInfo=false`. Every new `.cs` file must be added manually. - FB XML pin configuration files must be included as **``**, not ``: ```xml ``` - When adding a new FB with multiple source files, add all `` and the `` entry in a single csproj edit to avoid partial builds. +- `packages.config` is **gone** — the project uses `` exclusively. + +### Central Package Management + +- NuGet package versions are centrally managed in `Directory.Packages.props` at the + repo root (`ManagePackageVersionsCentrally=true`, + `CentralPackageTransitivePinningEnabled=true`). +- Add a new package by appending a `` + entry to `Directory.Packages.props`, then reference it from the consuming csproj + with `` — **no `Version=` attribute on the + `PackageReference`**. NuGet emits `NU1008` (hard error) if a `Version=` attribute + is left in place under CPM, and `NU1010` if a referenced id has no + `` entry. +- Dependabot is configured against the repo root and bumps versions in + `Directory.Packages.props` only; csproj files are not touched by version updates. + +### ILRepack and `[InternalsVisibleTo("Tests")]` + +- The merge target lives in `NtoLib/ILRepack.targets` and is wired in via the + `ILRepack.Lib.MSBuild.Task` package's `$(ILRepackTargetsFile)` hook. +- The target only runs when the `RunILRepack` MSBuild property is `true`. A plain + `dotnet build` therefore produces an **un-merged** DLL — this is required for the + Tests project to build, because merging internalises NuGet types that Tests also + references directly. +- `Build/Package.ps1` runs the test suite against the un-merged DLL first, then + re-invokes `dotnet build NtoLib/NtoLib.csproj -c Release -p:RunILRepack=true` to + produce the deployable merged artifact between the Test and Archive steps. +- `Build/tools/Merge.ps1` no longer exists; do not re-introduce a PowerShell merge + wrapper. ## Dependencies diff --git a/Build/Package.ps1 b/Build/Package.ps1 index 028c575..bbbec73 100644 --- a/Build/Package.ps1 +++ b/Build/Package.ps1 @@ -22,5 +22,14 @@ if (-not (Test-Path $RepoRoot)) & (Join-Path $ToolsDir 'Build.ps1') -Configuration $Configuration -RepoRoot $RepoRoot & (Join-Path $ToolsDir 'Test.ps1') -Configuration $Configuration -RepoRoot $RepoRoot -& (Join-Path $ToolsDir 'Merge.ps1') -Configuration $Configuration -RepoRoot $RepoRoot + +# Bundle NuGet runtime dependencies into NtoLib.dll via the ILRepack.targets MSBuild target. +# Gated by /p:RunILRepack=true so the preceding test build stays un-merged +# (see NtoLib/ILRepack.targets header for the rationale). +dotnet build (Join-Path $RepoRoot 'NtoLib\NtoLib.csproj') -c $Configuration -v minimal -p:RunILRepack=true --no-restore +if ($LASTEXITCODE -ne 0) +{ + throw "ILRepack merge step failed with exit code $LASTEXITCODE." +} + & (Join-Path $ToolsDir 'Archive.ps1') -Configuration $Configuration -RepoRoot $RepoRoot diff --git a/Build/deploy.ps1 b/Build/deploy.ps1 index a213c20..a8e7fcb 100644 --- a/Build/deploy.ps1 +++ b/Build/deploy.ps1 @@ -31,5 +31,14 @@ if ( [string]::IsNullOrWhiteSpace($ConfigurationDirectory)) } & (Join-Path $ToolsDir 'Build.ps1') -Configuration $Configuration -RepoRoot $RepoRoot -& (Join-Path $ToolsDir 'Merge.ps1') -Configuration $Configuration -RepoRoot $RepoRoot + +# Bundle NuGet runtime dependencies into NtoLib.dll via the ILRepack.targets MSBuild target. +# Gated by /p:RunILRepack=true so the preceding solution build stays un-merged +# (see NtoLib/ILRepack.targets header for the rationale). +dotnet build (Join-Path $RepoRoot 'NtoLib\NtoLib.csproj') -c $Configuration -v minimal -p:RunILRepack=true --no-restore +if ($LASTEXITCODE -ne 0) +{ + throw "ILRepack merge step failed with exit code $LASTEXITCODE." +} + & (Join-Path $ToolsDir 'Copy.ps1') -Configuration $Configuration -RepoRoot $RepoRoot -DestinationDirectory $DestinationDirectory -ConfigurationDirectory $ConfigurationDirectory diff --git a/Build/readme.md b/Build/readme.md index a24bdfb..84cf4da 100644 --- a/Build/readme.md +++ b/Build/readme.md @@ -53,23 +53,18 @@ powershell -NoProfile -ExecutionPolicy Bypass -File .\Build\tools\Build.ps1 ### 2) Слияние зависимостей (Merge) -Скрипт: `Build\tools\Merge.ps1` -Назначение: объединение `NtoLib.dll` и большинства managed-зависимостей в один файл с помощью **ILRepack**. +Слияние выполняется через MSBuild-таргет `NtoLib/ILRepack.targets`, использующий пакет **ILRepack.Lib.MSBuild.Task**. Отдельного скрипта `Merge.ps1` больше нет — таргет вызывается напрямую через `dotnet build` с флагом `-p:RunILRepack=true`. -Скрипт: -- берёт все `*.dll` из `NtoLib\bin\\` -- объединяет их в `NtoLib.dll` +Поведение таргета: +- объединяет managed-зависимости из `NtoLib\bin\\` в `NtoLib.dll` - **не включает** хостовые зависимости MasterSCADA (например `FB.dll`, `MasterSCADA.*`) и **не включает** `System.Resources.Extensions.dll` -- использует `/lib:` для каталогов поиска зависимостей при анализе ссылок +- активируется только при `RunILRepack=true`, чтобы юнит-тесты собирались с не-смерженной сборкой Запуск: ```powershell -powershell -NoProfile -ExecutionPolicy Bypass -File .\Build\tools\Merge.ps1 +dotnet build .\NtoLib\NtoLib.csproj -c Release -p:RunILRepack=true ``` -Требование: установлен ILRepack в каталоге: -- `NtoLib\packages\ILRepack.2.0.44\tools\ILRepack.exe` - ### 3) Тесты (Test) Скрипт: `Build\tools\Test.ps1` @@ -158,9 +153,9 @@ powershell -NoProfile -ExecutionPolicy Bypass -File .\Build\Package.ps1 ## Прямые команды dotnet (при необходимости) -Restore (packages.config): +Restore (PackageReference + Central Package Management через `Directory.Packages.props` в корне репозитория): ```powershell -dotnet msbuild .\NtoLib.sln /t:Restore /p:RestorePackagesConfig=true +dotnet restore .\NtoLib.sln ``` Build: diff --git a/Build/tools/Merge.ps1 b/Build/tools/Merge.ps1 deleted file mode 100644 index cc9fa28..0000000 --- a/Build/tools/Merge.ps1 +++ /dev/null @@ -1,160 +0,0 @@ -[CmdletBinding()] -param( - [string]$Configuration = $env:BUILD_CONFIGURATION, - [string]$RepoRoot -) - -$ErrorActionPreference = 'Stop' - -if ([string]::IsNullOrWhiteSpace($Configuration)) -{ - throw 'BUILD_CONFIGURATION is required.' -} -if ([string]::IsNullOrWhiteSpace($RepoRoot)) -{ - throw 'RepoRoot is required.' -} -if (-not (Test-Path $RepoRoot)) -{ - throw "RepoRoot does not exist: $RepoRoot" -} - -$binDir = Join-Path $RepoRoot "NtoLib\bin\$Configuration" -if (-not (Test-Path $binDir)) -{ - throw "Build output directory not found: $binDir" -} - -$ilRepackExe = Join-Path $RepoRoot 'packages\ILRepack.2.0.44\tools\ILRepack.exe' -if (-not (Test-Path $ilRepackExe)) -{ - throw "ILRepack.exe not found: $ilRepackExe" -} - -$finalDll = Join-Path $binDir 'NtoLib.dll' -if (-not (Test-Path $finalDll)) -{ - throw "Target assembly not found: $finalDll" -} - -$probeDirs = @( - $binDir, - (Join-Path $RepoRoot 'Resources') -) - -$excludedNameRegexes = @( - '^NtoLib\.dll$', - '^System\.Resources\.Extensions\.dll$', - '^FB\.dll$', - '^InSAT\..*\.dll$', - '^Insat\..*\.dll$', - '^MasterSCADA\..*\.dll$', - '^MasterScada\..*\.dll$', - '^MasterSCADALib\.dll$', - '^ICSharpCode\..*\.dll$', - '^OpcUaClient\.dll$', - '^System\.Text\.Json\.dll$', - '^System\.Text\.Encodings\.Web\.dll$' -) - -function IsExcluded([string]$fileName) -{ - foreach ($rx in $excludedNameRegexes) - { - if ($fileName -match $rx) - { - return $true - } - } - return $false -} - -$mergeOthers = @() -$allDlls = Get-ChildItem -Path $binDir -Filter *.dll -File -foreach ($f in $allDlls) -{ - if (IsExcluded $f.Name) - { - continue - } - $mergeOthers += $f.FullName -} - -if ($mergeOthers.Count -eq 0) -{ - return -} - -$backupDll = Join-Path $binDir 'NtoLib.ilrepack.input.dll' -$backupPdb = Join-Path $binDir 'NtoLib.ilrepack.input.pdb' -$originalPdb = Join-Path $binDir 'NtoLib.pdb' - -if (Test-Path $backupDll) -{ - Remove-Item $backupDll -Force -} -if (Test-Path $backupPdb) -{ - Remove-Item $backupPdb -Force -} - -Move-Item -Path $finalDll -Destination $backupDll -Force - -if (Test-Path $originalPdb) -{ - Move-Item -Path $originalPdb -Destination $backupPdb -Force -} - -$ilRepackArgs = @( - '/target:library', - "/out:$finalDll", - '/skipconfig', - '/internalize' -) - -foreach ($d in $probeDirs) -{ - if (Test-Path $d) - { - $ilRepackArgs += "/lib:$d" - } -} - -if ($env:NTOLIB_ILREPACK_LOG -eq '1') -{ - $ilRepackArgs += '/verbose' - $ilRepackArgs += "/log:$(Join-Path $binDir 'ilrepack.log')" -} - -$ilRepackArgs += $backupDll -$ilRepackArgs += $mergeOthers - -Push-Location $binDir -try -{ - & $ilRepackExe @ilRepackArgs - if ($LASTEXITCODE -ne 0) - { - throw "ILRepack failed with exit code $LASTEXITCODE." - } -} -catch -{ - if (Test-Path $finalDll) - { - Remove-Item $finalDll -Force - } - Move-Item -Path $backupDll -Destination $finalDll -Force - if (Test-Path $backupPdb) - { - Move-Item -Path $backupPdb -Destination $originalPdb -Force - } - throw -} -finally -{ - Pop-Location -} - -Remove-Item $backupDll -Force -ErrorAction SilentlyContinue -Remove-Item $backupPdb -Force -ErrorAction SilentlyContinue diff --git a/CLAUDE.md b/CLAUDE.md index 6824e46..04b2ca6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,19 +6,37 @@ via `netreg.exe`. - **Framework:** .NET Framework 4.8, C# 10, Nullable enabled - **Solution:** `NtoLib.sln` — two projects: `NtoLib` (main library) and `Tests` (xUnit) -- **csproj style:** Old-style with explicit `` entries (no wildcards) +- **csproj style:** SDK-style (``) with explicit + `` entries — default item globs are disabled + (`EnableDefaultCompileItems=false`, `EnableDefaultEmbeddedResourceItems=false`, + `EnableDefaultNoneItems=false`) so the "no wildcards" rule still holds. +- **NuGet:** `PackageReference` only; versions centrally managed in + `Directory.Packages.props` at the repo root (Central Package Management). ## Build ```powershell -dotnet build NtoLib.sln -Build/Package.ps1 # build + ILRepack merge + archive -Build/Deploy.ps1 # build + merge + copy to target machine +dotnet build NtoLib.sln # un-merged DLL (used by tests) +dotnet build NtoLib.sln -p:RunILRepack=true # merged DLL (used for deployment) +Build/Package.ps1 # build + test + ILRepack merge + archive +Build/deploy.ps1 # build + merge + copy to target machine ``` +`Build/Package.ps1` orchestrates the pipeline: it runs the test suite against the +un-merged DLL, then re-builds with `-p:RunILRepack=true` to produce the merged +artifact, then archives. + ILRepack merges all NuGet DLLs into a single `NtoLib.dll`, excluding vendor SDK DLLs -(`FB.dll`, `InSAT.*`, `MasterSCADA.*`). After build, `netreg.exe NtoLib.dll /showerror` -registers the COM component for MasterSCADA. +(`FB.dll`, `InSAT.*`, `MasterSCADA.*`). The merge step is implemented in +`NtoLib/ILRepack.targets` (invoked through MSBuild via the +`ILRepack.Lib.MSBuild.Task` package); the legacy `Build/tools/Merge.ps1` PowerShell +wrapper has been removed. The target is gated on the `RunILRepack` MSBuild +property so a plain `dotnet build` produces an un-merged DLL — this is intentional +and required, because `NtoLib` carries `[InternalsVisibleTo("Tests")]` and merging +internalised NuGet types into the assembly would collide with the Tests project's +own ``s on the same packages (CS0433 ambiguity on +`FluentResults.Result<>`, `Microsoft.Extensions.*`, etc.). After the merged build, +`netreg.exe NtoLib.dll /showerror` registers the COM component for MasterSCADA. ## Test @@ -46,7 +64,7 @@ Code Cleanup or `jb cleanupcode`. NtoLib/ ├── NtoLib/ main library (FB implementations) ├── Tests/ xUnit + FluentAssertions + Moq -├── Build/ PowerShell pipeline (Package.ps1, Deploy.ps1, tools/) +├── Build/ PowerShell pipeline (Package.ps1, deploy.ps1, tools/) ├── Docs/ documentation │ ├── architecture/ primer + NtoLib patterns (LLM-targeted, not user-facing) │ ├── known_issues/ platform-level bug classes with cause and workaround @@ -72,14 +90,46 @@ for the reading order). ## csproj Conventions -- `NtoLib.csproj` uses **explicit `` entries** — no wildcards. Every new - `.cs` file must be added manually. +- `NtoLib.csproj` is **SDK-style** (``) but uses + **explicit `` entries** — no wildcards. Default item globs are + disabled via `EnableDefaultCompileItems=false`, + `EnableDefaultEmbeddedResourceItems=false`, `EnableDefaultNoneItems=false`, and + `GenerateAssemblyInfo=false`. Every new `.cs` file must be added manually. - FB XML pin configuration files must be included as **``**, not ``: ```xml ``` - When adding a new FB with multiple source files, add all `` and the `` entry in a single csproj edit to avoid partial builds. +- `packages.config` is **gone** — the project uses `` exclusively. + +### Central Package Management + +- NuGet package versions are centrally managed in `Directory.Packages.props` at the + repo root (`ManagePackageVersionsCentrally=true`, + `CentralPackageTransitivePinningEnabled=true`). +- Add a new package by appending a `` + entry to `Directory.Packages.props`, then reference it from the consuming csproj + with `` — **no `Version=` attribute on the + `PackageReference`**. NuGet emits `NU1008` (hard error) if a `Version=` attribute + is left in place under CPM, and `NU1010` if a referenced id has no + `` entry. +- Dependabot is configured against the repo root and bumps versions in + `Directory.Packages.props` only; csproj files are not touched by version updates. + +### ILRepack and `[InternalsVisibleTo("Tests")]` + +- The merge target lives in `NtoLib/ILRepack.targets` and is wired in via the + `ILRepack.Lib.MSBuild.Task` package's `$(ILRepackTargetsFile)` hook. +- The target only runs when the `RunILRepack` MSBuild property is `true`. A plain + `dotnet build` therefore produces an **un-merged** DLL — this is required for the + Tests project to build, because merging internalises NuGet types that Tests also + references directly. +- `Build/Package.ps1` runs the test suite against the un-merged DLL first, then + re-invokes `dotnet build NtoLib/NtoLib.csproj -c Release -p:RunILRepack=true` to + produce the deployable merged artifact between the Test and Archive steps. +- `Build/tools/Merge.ps1` no longer exists; do not re-introduce a PowerShell merge + wrapper. ## Dependencies diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 0000000..2e43aaf --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,71 @@ + + + true + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/known_issues/02-dll-merge-constraints.md b/Docs/known_issues/02-dll-merge-constraints.md index bffd81c..b32ccec 100644 --- a/Docs/known_issues/02-dll-merge-constraints.md +++ b/Docs/known_issues/02-dll-merge-constraints.md @@ -35,3 +35,20 @@ ILRepack работает, но с ограничениями: 3. **Известные "не-mergeable" зависимости доставлять отдельно** рядом с основной DLL. 4. **Придерживаться принципа наименьшего количества файлов** в поставке. + +## Гейт `RunILRepack` и `[InternalsVisibleTo("Tests")]` + +После миграции на `ILRepack.Lib.MSBuild.Task` (см. `NtoLib/ILRepack.targets`) шаг merge +гейтится свойством `RunILRepack=true`. Снять гейт нельзя — это сломает Tests. + +Причина: `NtoLib` декларирует `[assembly: InternalsVisibleTo("Tests")]`. Если ILRepack +запускается на каждой `dotnet build`, NuGet-типы (например `FluentResults.Result<>`) +попадают внутрь `NtoLib.dll` как internal. Tests подтягивает те же пакеты напрямую +через `PackageReference`, и компилятор видит каждый такой тип в двух сборках +одновременно — получает CS0433 (ambiguous reference). + +Поэтому: +- `dotnet build NtoLib.sln -c Release` (без `-p:RunILRepack=true`) собирает unmerged + `NtoLib.dll` -- именно то, что нужно для unit-тестов. +- `Build/Package.ps1` и `Build/Deploy.ps1` передают `-p:RunILRepack=true` уже **после** + Test-шага, чтобы выпустить merge-артефакт. diff --git a/Docs/plans/completed/20260425-cpm-migration.md b/Docs/plans/completed/20260425-cpm-migration.md new file mode 100644 index 0000000..df27df2 --- /dev/null +++ b/Docs/plans/completed/20260425-cpm-migration.md @@ -0,0 +1,467 @@ +# Migrate NtoLib to PackageReference + Central Package Management + +## Overview + +Today the solution mixes two NuGet formats: `NtoLib.csproj` is old-style with +`packages.config` (50+ packages, restored to `..\packages\`), while +`Tests.csproj` is sdk-style with `PackageReference` (restored to the global +NuGet cache). Because the formats are isolated, dependabot bumps in NtoLib +break the test project at runtime — Tests sees `NtoLib.dll` but its own +auto-generated `Tests.dll.config` does not include binding redirects for +NtoLib's transitive dependencies. The dependabot fallout that triggered this +plan was exactly that: AngouriMath 1.4 + transitive bumps (PeterO.Numbers, +GenericTensor, IndexRange, Microsoft.Bcl.HashCode) caused +`FileNotFoundException` in `MathS` static ctor inside the xunit test host. + +The migration consolidates dependency management: + +1. Convert `NtoLib.csproj` from `packages.config` to `PackageReference`. +2. Adopt Central Package Management via `Directory.Packages.props` at repo root. +3. Both projects then reference packages by id only; versions live in one file. +4. ILRepack moves from a `` of a `..\packages\` props file to the + sdk-friendly `ILRepack.Lib.MSBuild.Task` package, keeping the bundling step + inside MSBuild. Fallback: invoke ILRepack as a `dotnet tool` from + `Build/tools/Merge.ps1` if the MSBuild integration misbehaves. + +After migration: +- `Tests.dll.config` is auto-generated correctly because Tests now sees the + full transitive graph through `ProjectReference` (PackageReference flows + through, packages.config did not). +- `Tests/App.config` (the band-aid added in the dependabot PR) becomes + redundant and is removed. +- Future dependabot bumps update `Directory.Packages.props` only. + +## Context (from discovery) + +Files/components involved: +- `NtoLib/NtoLib.csproj` — old-style, ~270 lines, ~50 `` +- `NtoLib/packages.config` — 50+ entries, deletes +- `NtoLib/App.config` — does not exist; binding redirects auto-generated into + `bin\$(Configuration)\NtoLib.dll.config` +- `Tests/Tests.csproj` — sdk-style, already uses `PackageReference` +- `Tests/App.config` — binding-redirect band-aid from PR #94, deletes after migration +- `Build/tools/Merge.ps1` — hardcoded `packages\ILRepack.2.0.44\tools\ILRepack.exe` +- `.config/dotnet-tools.json` — already has `dotnet-reportgenerator-globaltool`, + prior art for global tools +- `.github/workflows/ci.yml` (master) — runs `nuget restore NtoLib.sln && dotnet restore NtoLib.sln`; + the `nuget restore` step becomes unnecessary after migration +- `Build/Package.ps1`, `Build/Deploy.ps1` — orchestrators, don't touch packages directly +- `Resources/*.dll` — vendor SDK references via ``, + unchanged by this migration + +Patterns/constraints discovered: +- `NtoLib.csproj` ``s three package-provided MSBuild targets: + `ILRepack.props`, `System.ValueTuple.targets`, `Serilog.4.3.1\build\Serilog.targets`. + PackageReference handles `Serilog.targets` automatically. `System.ValueTuple` is + redundant on net48. ILRepack moves to `ILRepack.Lib.MSBuild.Task`. +- The csproj enforces "explicit `` entries — no wildcards" + (CLAUDE.md). PackageReference does not change that — the `` for + source files stays as-is. +- COM registration via `netreg.exe NtoLib.dll` post-build is unaffected — it + consumes the merged DLL, not the package layout. +- Tests pass on dependabot branch only after `Tests/App.config` was added as + a band-aid; that file is deleted by Task 5 once migration completes. + +Dependencies identified (NuGet, all currently in `NtoLib/packages.config` per +last dependabot bump): +- AngouriMath 1.4.0 (+ transitives: Antlr4.Runtime.Standard, GenericTensor, + HonkPerf.NET.Core, HonkSharp, IndexRange, PeterO.Numbers) +- CsvHelper 33.1.0 +- EasyModbusTCP 5.6.0 +- FluentResults 4.0.0 +- ILRepack 2.0.44 (replaced by ILRepack.Lib.MSBuild.Task) +- Microsoft.Bcl.* 10.0.7 / 6.0.0 +- Microsoft.Extensions.* 10.0.7 +- OneOf 3.0.271 +- Polly + Polly.Core 8.6.6 +- Serilog 4.3.1, Serilog.Extensions.Logging 10.0.0, Serilog.Sinks.{Console,Debug,File} +- System.* (Buffers, Collections.Immutable, ComponentModel.Annotations, + Diagnostics.DiagnosticSource, Formats.Nrbf, IO.Pipelines, Memory, + Numerics.Vectors, Reflection.Metadata, Resources.Extensions, + Runtime.CompilerServices.Unsafe, Text.Encodings.Web, Text.Json, + Threading.Channels, Threading.Tasks.Extensions) +- YamlDotNet 17.0.1 + +## Development Approach + +- **testing approach**: Regular — verify each task by running existing test + suite (225 tests). No new tests required; this is a build-system migration + with no behavioral code changes. The existing test suite is the regression + oracle. +- complete each task fully before moving to the next +- after each task: `dotnet build NtoLib.sln -c Release` must succeed AND + `dotnet test NtoLib.sln -c Release` must report 225/225 passing +- if a task breaks the build or tests, fix it inside the same task before moving on +- maintain backward compatibility: produced `NtoLib.dll` must remain + byte-equivalent in surface (same merged types, same COM-visible entrypoints). + The acceptance gate is: `Build/Package.ps1` produces a merged DLL that + passes `netreg.exe NtoLib.dll /showerror` (verifiable manually post-merge). +- **CRITICAL: update this plan file when scope changes during implementation** + +## Testing Strategy + +- **regression**: `dotnet test NtoLib.sln -c Release` after every task, + 225/225 passing as the bar. +- **build artifact verification**: after Task 4 (ILRepack migration), + produce `NtoLib.dll` via `Build/Package.ps1` and inspect it (e.g. + `ilspycmd NtoLib.dll -l class` to confirm types from merged libs are + internalized as before). +- **no new unit tests**: this is build-config plumbing, not product code. + +## Progress Tracking + +- mark completed items with `[x]` immediately when done +- add newly discovered tasks with the prefix +- document issues/blockers with prefix +- update plan if implementation deviates + +## Solution Overview + +Two-axis change: + +1. **Format migration** (per project): old-style csproj + packages.config → + sdk-style csproj would be the textbook move, but NtoLib.csproj has heavy + custom `` and embedded resource layout that an + sdk-style migration would either flatten with wildcards (against + CLAUDE.md rule) or require enumerating manually anyway. So we keep + `NtoLib.csproj` as **old-style csproj with `PackageReference`** — this + is supported by MSBuild and is a smaller, safer diff than sdk-style + conversion. + +2. **Central Package Management**: `Directory.Packages.props` at repo root + declares `` for every + package used anywhere. Both `NtoLib.csproj` and `Tests.csproj` then + reference packages with `` (no version). + +3. **ILRepack**: replace `` + with `` + plus a `` invocation in + the csproj. `Build/tools/Merge.ps1` is deleted (its work moves into + MSBuild). `Build/Package.ps1` simplifies to: build → archive (Test step + stays). + - **Fallback**: if the MSBuild task misbehaves, restore `Build/tools/Merge.ps1` + using the `dotnet ilrepack` global tool (added to `.config/dotnet-tools.json`). + Document the fallback in `Build/tools/Merge.ps1` header comment if used. + +## Technical Details + +### `Directory.Packages.props` skeleton + +```xml + + + true + true + + + + + + + +``` + +### `NtoLib.csproj` reference style after migration + +```xml + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + +``` + +All `..\packages\..` +items go away — MSBuild resolves the assemblies from the package via +PackageReference. + +Vendor SDK references stay (`..\Resources\FB.dll`) +— they are not NuGet packages. + +### ILRepack target inside `NtoLib.csproj` + +```xml + + + + + + + +``` + +Exact exclude list mirrors the regex set currently in `Build/tools/Merge.ps1`. + +### CI workflow update + +`.github/workflows/ci.yml` (master) currently runs: + +```yaml +- run: nuget restore NtoLib.sln +- run: dotnet restore NtoLib.sln +``` + +After migration `nuget restore` is unnecessary; the workflow simplifies to +just `dotnet restore`. The dependabot PR's branch already only runs +`dotnet restore`, so on master we drop the `nuget restore` line and the +`NuGet/setup-nuget@v2` action. + +## What Goes Where + +- **Implementation Steps** (`[ ]` checkboxes): all changes inside this repo — + csproj surgery, new files, deletions, CI workflow tweaks, test runs. +- **Post-Completion** (no checkboxes): manual verification that the merged + `NtoLib.dll` registers cleanly via `netreg.exe` on a target MasterSCADA + machine; rebasing the open dependabot PR #94 onto master after this work + lands. + +## Implementation Steps + +### Task 1: Add `Directory.Packages.props` (declare versions, do not consume yet) + +**Files:** +- Create: `Directory.Packages.props` (repo root) + +- [x] create `Directory.Packages.props` with `ManagePackageVersionsCentrally=true` + and `` entries for every package currently in + `NtoLib/packages.config` and `Tests/Tests.csproj` +- [x] include `` + (latest stable; verify on nuget.org during execution) +- [x] do not yet remove `` from existing `` in `Tests.csproj` — + that lands in Task 3 + - **deviation:** plan premise was incorrect. Enabling + `ManagePackageVersionsCentrally=true` makes NuGet emit `NU1008` (hard error, + not warning) when any `` retains a `Version=` attribute, so + restore fails. Resolution: stripped `Version=` attributes from + `Tests/Tests.csproj` PackageReferences during Task 1. This is the same edit + Task 3 prescribes for `Tests.csproj`; Task 3 still owns the equivalent edit + for `NtoLib.csproj` (which currently uses `packages.config`, not + `PackageReference`, so it is unaffected by NU1008 for now). +- [x] run `dotnet restore NtoLib.sln && dotnet build NtoLib.sln -c Release` — + build still uses old paths, so it must succeed unchanged +- [x] run `dotnet test NtoLib.sln -c Release` — 225/225 + +### Task 2: Convert `NtoLib.csproj` from packages.config to PackageReference + +**Files:** +- Modify: `NtoLib/NtoLib.csproj` +- Delete: `NtoLib/packages.config` + +- [x] remove `` line +- [x] remove `` line + - n/a: original csproj had only `` (framework + reference, redundant on net48); no `` for `System.ValueTuple.targets` was + present. Removed the framework reference along with the rest in the SDK migration. +- [x] remove `` line + - actual path was `..\packages\Serilog.4.3.0\build\Serilog.targets`; removed. +- [x] remove the `` block at end of csproj that errors on missing `..\packages\..\*.props/.targets` +- [x] replace every `....\packages\..` block with + `` (Version retained for now; + Task 3 strips it after CPM kicks in fully) + - **deviation:** CPM is already active (Task 1 enabled `ManagePackageVersionsCentrally=true`), + so `Version=` attributes on `` produce NU1008 errors at restore + (same situation as Tests.csproj in Task 1). Versions were therefore omitted + from new `` entries in this task; Task 3's NtoLib version-strip + bullet is consequently a no-op. +- [x] vendor SDK `` items (`FB`, `InSAT.Library`, `MasterSCADA.*`, + `OpcUaClient`, `Opc.Ua.Core`, `ICSharpCode.*`, `COMDeviceSDK`) stay untouched +- [x] delete `NtoLib/packages.config` +- [x] run `dotnet restore NtoLib.sln && dotnet build NtoLib.sln -c Release` — + expect: build succeeds, `bin\Release\NtoLib.dll.config` is auto-generated + with binding redirects for the same set of packages as before + - **deviation: csproj converted to SDK-style** (``) + rather than kept as old-style. Old-style csproj + PackageReference does not import + NuGet's `ResolvePackageAssets` target chain, so package compile assets never reach + the C# compiler's reference list (verified: `dotnet msbuild -t:ResolvePackageAssets` + fails with MSB4057 "no such target", and 849 CS0246 errors on every NuGet-supplied + type during build). SDK-style is the supported path. To preserve the "no wildcards" + rule from CLAUDE.md, default item globs are disabled via + `EnableDefaultCompileItems=false`, `EnableDefaultEmbeddedResourceItems=false`, + `EnableDefaultNoneItems=false`, `GenerateAssemblyInfo=false`. To keep + `bin\Release\NtoLib.dll` flat (no `net48\` suffix) so `Build/tools/Merge.ps1` + keeps working, set `AppendTargetFrameworkToOutputPath=false` and + `AppendTargetFrameworkToIntermediateOutputPath=false`. WPF/WinForms toggled on via + `UseWindowsForms=true` and `UseWPF=true`. Framework references that the SDK provides + automatically (`mscorlib`, `System`, `System.Core`, `System.Drawing`, `System.Xml`, + `System.Xml.Linq`, `System.Numerics`, `System.Runtime`, `System.Runtime.Serialization`, + `System.Data`, `System.Windows.Forms`, `PresentationCore`, `PresentationFramework`, + `WindowsBase`) were dropped from the csproj; non-default ones + (`System.ComponentModel.DataAnnotations`, `System.Configuration`, + `System.Data.DataSetExtensions`, `System.Net.Http`) kept as explicit ``. +- [x] run `dotnet test NtoLib.sln -c Release` — 225/225, even **without** + `Tests/App.config` (because Tests now resolves NtoLib's transitive graph + via PackageReference). Verify by `git stash` of `Tests/App.config` before + the test run; if green, restore from stash for now (Task 5 deletes it) + - `Tests/App.config` does not exist on this branch (already absent), so the + "without App.config" verification is satisfied implicitly: `dotnet test` ran + 225/225 with no App.config file present. Task 5's deletion is therefore a no-op + on this branch. + +### Task 3: Strip versions from PackageReferences (activate CPM) + +**Files:** +- Modify: `NtoLib/NtoLib.csproj` +- Modify: `Tests/Tests.csproj` + +- [x] remove `Version="..."` attributes from every `` in `NtoLib.csproj` + (already done in Task 2 — NU1008 hard error forced version omission when CPM was + enabled in Task 1; verified 0 `Version=` occurrences in `` tags) +- [x] remove `Version="..."` attributes from every `` in `Tests.csproj` + (already done in Task 1 — same NU1008 reason; verified 0 `Version=` occurrences) +- [x] confirm versions in `Directory.Packages.props` cover every package id used + (build will fail with `NU1010` if one is missing) — verified all ids in both + csprojs map to a `` entry +- [x] run `dotnet restore NtoLib.sln && dotnet build NtoLib.sln -c Release` — must succeed + (clean build, 0 errors) +- [x] run `dotnet test NtoLib.sln -c Release` — 225/225 (passed 225, failed 0, skipped 0) + +### Task 4: Migrate ILRepack from packages.config to MSBuild.Task + +**Files:** +- Modify: `NtoLib/NtoLib.csproj` +- Modify: `Build/Package.ps1` +- Delete: `Build/tools/Merge.ps1` + +- [x] add `all...` + to `NtoLib.csproj` (replaces the previous `ILRepack` PackageReference) +- [x] add `` to + `Directory.Packages.props` (was already declared during Task 1; the obsolete + `ILRepack` PackageVersion entry was removed) +- [x] add `` block, mirroring the + exclude list from the deleted `Merge.ps1` + - **deviation:** the package's targets file declares its own `ILRepack` target + with `AfterTargets="Build"` whenever `$(Configuration).Contains('Release')`. + A custom target sitting in the same csproj does not suppress the default — + both run, and the default has no LibraryPath set, so it fails to resolve the + vendor `FB` reference. Resolution: place the project-specific target in + `NtoLib/ILRepack.targets` and point `$(ILRepackTargetsFile)` at it; the + package then imports the file (line 9) and skips its built-in target + (line 10 condition). + - **deviation:** `LibraryPath` on the `ILRepack` task is `ITaskItem[]`, so it + must be passed as an item list (`@(ILRepackLibraryPath)`), not as a + semicolon-separated string. The Technical Details snippet in this plan was + a string and would not have worked. + - **deviation:** the merge target is gated on `$(RunILRepack)=true` instead of + running on every Release build. NtoLib carries + `[InternalsVisibleTo("Tests")]`; running ILRepack at the end of every + `dotnet build` makes the internalised NuGet types visible to the Tests + project alongside the real NuGet references, producing CS0433 ambiguity on + types like `FluentResults.Result<>`, `Microsoft.Extensions.DependencyInjection.ServiceProvider`, + and `Microsoft.Extensions.Logging.ILoggerFactory`. The plan's note that + "When ILRepack runs as part of `Build`, it will run after every dotnet + build. That's expected behavior" was incorrect for this codebase. The + merge therefore runs only when `Build/Package.ps1` invokes + `dotnet build NtoLib.csproj -p:RunILRepack=true` after the test step. +- [x] delete `Build/tools/Merge.ps1` +- [x] remove `& (Join-Path $ToolsDir 'Merge.ps1') ...` line from `Build/Package.ps1` + (replaced with an inline `dotnet build -p:RunILRepack=true` invocation) +- [x] run `dotnet build NtoLib.sln -c Release` — verified `bin\Release\NtoLib.dll` + goes from 0.86 MB (un-merged) to 5.46 MB (merged); `ilspycmd ... -l class` + shows internalised types from `AngouriMath`, `Polly`, `Serilog`, `YamlDotNet`, + `Microsoft.Extensions.*` etc. +- [x] run `Build/Package.ps1 -Configuration Release -RepoRoot .` — succeeds + end-to-end (Build, Test 225/225, Merge, Archive → `Releases/NtoLib_v1.12.0-beta1.zip`) +- [x] run `dotnet test NtoLib.sln -c Release` — 225/225 (passed 225, failed 0, + skipped 0) +- [x] **fallback gate**: not triggered. Option A (ILRepack.Lib.MSBuild.Task) + succeeded; merged DLL contains internalised NuGet namespaces and the test + suite passes against the un-merged build. + +### Task 5: Remove the `Tests/App.config` band-aid + +**Files:** +- Delete: `Tests/App.config` + +- [x] delete `Tests/App.config` (Tests/App.config never existed on this branch — verified) +- [x] run `dotnet build NtoLib.sln -c Release` — must succeed (Tests/App.config never existed on this branch — verified) +- [x] run `dotnet test NtoLib.sln -c Release` — 225/225 (this is the proof + that CPM migration solved the actual problem; if any test fails the + migration is incomplete) (Tests/App.config never existed on this branch — verified) + +### Task 6: Update CI workflow + +**Files:** +- Modify: `.github/workflows/ci.yml` + +- [x] remove the `NuGet/setup-nuget@v2` step (no longer needed, no packages.config) +- [x] simplify the `restore` step to a single `dotnet restore NtoLib.sln` +- [x] note: this lands on master after the migration PR is merged. On the + migration branch itself, `nuget restore` is harmless (no packages.config + found = no-op), so leaving it in until the PR merges is fine. + +### Task 7: Verify acceptance criteria + +- [x] all requirements from Overview implemented: + - [x] `NtoLib.csproj` uses `PackageReference` (no `` versions are managed centrally — + bumps go to `Directory.Packages.props` (covered in NtoLib/AGENTS.md "Central + Package Management" subsection) +- [x] note removal of `Build/tools/Merge.ps1` and shift of merging into MSBuild + (covered in NtoLib/AGENTS.md "ILRepack and `[InternalsVisibleTo(\"Tests\")]`" + subsection, plus the `Build` shell snippet now distinguishes + `-p:RunILRepack=true` for merged builds) +- [x] move this plan to `docs/plans/completed/` + +## Post-Completion + +*Manual / external verification — no checkboxes.* + +**Manual verification:** +- Run `Build/Deploy.ps1` against a real MasterSCADA target machine; confirm + `netreg.exe NtoLib.dll /showerror` registers cleanly. The merged-DLL + layout is the most likely place for CPM-induced regressions to surface + (e.g. ILRepack internalizing or skipping a different set of assemblies + than before). +- Open the merged `NtoLib.dll` in a MasterSCADA project, instantiate one of + each FB family (one headless, one visual), confirm pin behavior is + unchanged. + +**External system updates:** +- Rebase open dependabot PR #94 onto migration-merged master. Most of its + diff (csproj reference rewrites) becomes a no-op because the post-migration + csproj has no version-pinned hint paths to update — dependabot now updates + `Directory.Packages.props` only. Either close PR #94 and let dependabot + reopen against `Directory.Packages.props`, or rebase manually if version + bumps need to ship in this same window. +- Verify dependabot config in `dot-config/` (or `.github/dependabot.yml` + depending on which one is active) handles CPM — modern dependabot does + natively, but if `dot-config/` pins a specific manifest path, update it. diff --git a/NtoLib/ILRepack.targets b/NtoLib/ILRepack.targets new file mode 100644 index 0000000..68eb88b --- /dev/null +++ b/NtoLib/ILRepack.targets @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + diff --git a/NtoLib/NtoLib.csproj b/NtoLib/NtoLib.csproj index 44152f0..00ab33e 100644 --- a/NtoLib/NtoLib.csproj +++ b/NtoLib/NtoLib.csproj @@ -1,7 +1,4 @@ - - - - + Debug AnyCPU @@ -10,15 +7,21 @@ Properties NtoLib NtoLib - v4.8 + net48 + false + false 512 true - - - 10 true enable + + false + false + false + false + true + true true @@ -41,41 +44,19 @@ false - - ..\packages\AngouriMath.1.3.0\lib\net472\AngouriMath.dll - - - ..\packages\Antlr4.Runtime.Standard.4.9.2\lib\netstandard2.0\Antlr4.Runtime.Standard.dll - + ..\resources\COMDeviceSDK.dll - - - ..\packages\CsvHelper.33.1.0\lib\net48\CsvHelper.dll - - - ..\packages\EasyModbusTCP.5.6.0\lib\net40\EasyModbus.dll + False ..\Resources\FB.dll False - - ..\packages\FluentResults.4.0.0\lib\netstandard2.0\FluentResults.dll - - - ..\packages\GenericTensor.1.0.4\lib\net472\GenericTensor.dll - - - ..\packages\HonkSharp.1.0.1\lib\net472\HonkSharp.dll - ..\Resources\ICSharpCode.Core.Presentation.dll False - - ..\packages\IndexRange.1.0.0\lib\net471\IndexRange.dll - ..\Resources\InSAT.Library.dll False @@ -84,9 +65,6 @@ ..\Resources\Insat.Opc.dll False - - ..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.7\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll - ..\Resources\Opc.Ua.Core.dll False @@ -113,127 +91,68 @@ ..\Resources\OpcUaClient.dll - false - - - ..\packages\Microsoft.Bcl.HashCode.1.1.1\lib\net461\Microsoft.Bcl.HashCode.dll - - - ..\packages\Microsoft.Bcl.TimeProvider.8.0.0\lib\net462\Microsoft.Bcl.TimeProvider.dll - - - ..\packages\Microsoft.Extensions.DependencyInjection.9.0.8\lib\net462\Microsoft.Extensions.DependencyInjection.dll - - - ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.9.0.8\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - - ..\packages\Microsoft.Extensions.Logging.9.0.0\lib\net462\Microsoft.Extensions.Logging.dll - - - ..\packages\Microsoft.Extensions.Logging.Abstractions.9.0.0\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll - - - ..\packages\Microsoft.Extensions.Options.9.0.0\lib\net462\Microsoft.Extensions.Options.dll - - - ..\packages\Microsoft.Extensions.Primitives.9.0.0\lib\net462\Microsoft.Extensions.Primitives.dll - - - - ..\packages\PeterO.Numbers.1.8.0\lib\net40\Numbers.dll - - - ..\packages\OneOf.3.0.271\lib\net45\OneOf.dll - - - ..\packages\Polly.8.6.4\lib\net472\Polly.dll - - - ..\packages\Polly.Core.8.6.4\lib\net472\Polly.Core.dll - - - - - ..\packages\Serilog.4.3.0\lib\net471\Serilog.dll - - - ..\packages\Serilog.Extensions.Logging.9.0.2\lib\net462\Serilog.Extensions.Logging.dll - - - ..\packages\Serilog.Sinks.Console.6.0.0\lib\net471\Serilog.Sinks.Console.dll - - - ..\packages\Serilog.Sinks.Debug.3.0.0\lib\net471\Serilog.Sinks.Debug.dll - - - ..\packages\Serilog.Sinks.File.7.0.0\lib\net471\Serilog.Sinks.File.dll - - - - ..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll - - - ..\packages\System.Collections.Immutable.9.0.7\lib\net462\System.Collections.Immutable.dll - - - ..\packages\System.ComponentModel.Annotations.4.5.0\lib\net461\System.ComponentModel.Annotations.dll + False + - - - ..\packages\System.Diagnostics.DiagnosticSource.9.0.0\lib\net462\System.Diagnostics.DiagnosticSource.dll - - - - ..\packages\System.Formats.Nrbf.9.0.7\lib\net462\System.Formats.Nrbf.dll - - - ..\packages\System.IO.Pipelines.10.0.7\lib\net462\System.IO.Pipelines.dll - - - ..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll - - - - ..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll - - - ..\packages\System.Reflection.Metadata.9.0.7\lib\net462\System.Reflection.Metadata.dll - - - ..\packages\System.Resources.Extensions.9.0.7\lib\net462\System.Resources.Extensions.dll - - - - ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll - - - - ..\packages\System.Text.Encodings.Web.10.0.7\lib\net462\System.Text.Encodings.Web.dll - - - ..\packages\System.Text.Json.10.0.7\lib\net462\System.Text.Json.dll - - - ..\packages\System.Threading.Channels.8.0.0\lib\net462\System.Threading.Channels.dll - - - ..\packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll - - - - - - - - - - ..\packages\YamlDotNet.16.3.0\lib\net47\YamlDotNet.dll - + + + + + + + + + + + + all + + build; buildtransitive; analyzers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -854,7 +773,6 @@ PreserveNewest - SettingsSingleFileGenerator Settings.Designer.cs @@ -893,13 +811,12 @@ - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - + + + $(MSBuildProjectDirectory)\ILRepack.targets + diff --git a/NtoLib/app.config b/NtoLib/app.config index 6bf68c7..bdece8b 100644 --- a/NtoLib/app.config +++ b/NtoLib/app.config @@ -107,7 +107,7 @@ - + diff --git a/NtoLib/packages.config b/NtoLib/packages.config deleted file mode 100644 index 1ac6756..0000000 --- a/NtoLib/packages.config +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 3c1ec4d..b7df35a 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -10,25 +10,25 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - + + + + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/nuget.config b/nuget.config new file mode 100644 index 0000000..4d736c1 --- /dev/null +++ b/nuget.config @@ -0,0 +1,7 @@ + + + + + + +