Skip to content

[Refactor] centralize shared MSBuild/package settings, require .NET 10 SDK and C# 14 - #83

Merged
samatstariongroup merged 2 commits into
developmentfrom
issue-80-centralize-msbuild-props
Oct 18, 2026
Merged

samatstariongroup merged 2 commits into
developmentfrom
issue-80-centralize-msbuild-props

Conversation

@samatstariongroup

@samatstariongroup samatstariongroup commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Fixes #80

Summary

Settings that both packages repeated now live in one place, and each library .csproj keeps only its own settings: target framework, version, title, description, package ID, icon, authors and release notes.

File Holds
Directory.Build.props Settings for every project: company, copyright, repository, Deterministic, languages, LangVersion 14.0, GenerateDocumentationFile
Directory.Build.targets (new) Packaging settings, only for projects that can be packed ('$(IsPackable)' != 'false'): project URL, license, tags, GeneratePackageOnBuild, RequireLicenseAcceptance, IncludeSource/IncludeSymbols, GenerateSBOM, PackageReadmeFile, the README/LICENSE/NOTICE pack items and the Microsoft.Sbom.Targets reference
global.json (new) Requires the .NET 10 SDK (10.0.100, rollForward: latestFeature)

Why there are two files

  • Packaging settings go in .targets. The test projects set IsPackable in their own project files, which are read after Directory.Build.props. Only Directory.Build.targets is read late enough to check it.
  • GenerateDocumentationFile stays in .props. The SDK works out the documentation file settings before it reads Directory.Build.targets. When I tried setting it there, the packages lost their XML docs. So the test projects turn it off themselves, next to their existing <IsPackable>false</IsPackable>.

Language version and SDK

  • LangVersion goes from 12.0 to 14.0 for all projects. That is the version the test projects already used by default on net10.0.
  • The libraries still target netstandard2.0, so features that need runtime support stay unavailable there: default interface methods, static abstract interface members and ref fields.
  • C# 14 requires the .NET 10 SDK, which global.json now states. CI already installs 10.0.x.

Other

  • CLAUDE.md gets a short "MSBuild layout" section and a note on the SDK requirement.
  • .gitignore now ignores /.claude/agent-memory-local/.

Verification

  • dotnet build ReqIFSharp.sln -c Release: 0 warnings, 0 errors.
  • dotnet test ReqIFSharp.sln -c Release --no-build: 305 + 84 tests pass.
  • dotnet pack packages compared with those from development:
    • all four .nupkg / .symbols.nupkg contain the same files
    • .nuspec files are identical apart from the commit hash
    • XML documentation files are identical
    • the SBOM is still included
  • I checked the evaluated properties: the test projects get no packaging settings, no SBOM reference and no documentation file.
  • A pre-PR review found no correctness problems. It noted that the C# 12 → 14 builds produce the same IL. Its two suggestions are addressed here: the SDK requirement is now stated in global.json, and packable projects are found through IsPackable instead of the .Tests name check.

🤖 Generated with Claude Code

samatstarion and others added 2 commits October 18, 2026 11:25
…Build.props

- move LangVersion into Directory.Build.props and raise it to 14.0 for all projects
- move the shared packaging properties, the README/LICENSE/NOTICE pack items and the
  Microsoft.Sbom.Targets reference into Directory.Build.props, excluding *.Tests projects
- keep only per-package settings in ReqIFSharp.csproj and ReqIFSharp.Extensions.csproj

Fixes #80

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…targets

- move the shared packaging settings, pack items and Microsoft.Sbom.Targets reference
  into Directory.Build.targets, guarded by '$(IsPackable)' != 'false', replacing the
  *.Tests project-name check
- keep GenerateDocumentationFile in Directory.Build.props (the SDK derives the
  documentation-file settings before .targets is evaluated); test projects turn it off
- add global.json requiring the .NET 10 SDK (rollForward latestFeature)
- document the MSBuild layout and SDK requirement in CLAUDE.md
- ignore the local agent memory folder

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@samatstariongroup samatstariongroup changed the title [Refactor] move shared MSBuild and package properties into Directory.Build.props [Refactor] centralize shared MSBuild/package settings, require .NET 10 SDK and C# 14 Oct 18, 2026
@sonarqubecloud

Copy link
Copy Markdown

@samatstariongroup
samatstariongroup merged commit 1071aff into development Oct 18, 2026
8 checks passed
@samatstariongroup
samatstariongroup deleted the issue-80-centralize-msbuild-props branch October 18, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move shared/common MSBuild and package properties into Directory.Build.props

1 participant