Apply template updates: Polyfill, netstandard2.0, and net481 Windows test evidence#120
Conversation
…tstandard2.0 support - Add netstandard2.0 to TargetFrameworks in library project - Add Polyfill 9.12.0 package with PolyArgumentExceptions=true - Update LangVersion from 12 to latest in both projects - Update SonarAnalyzer.CSharp from 10.19.0.132793 to 10.20.0.135146 - Update Microsoft.NET.Test.Sdk from 18.0.1 to 18.3.0 - Add System.Text.Json conditional references (9.0.5 for netstandard2.0, 10.0.3 for net8+) - Add HashCodePolyfill.cs for System.HashCode on netstandard2.0 - Add #if NET7_0_OR_GREATER guard in SpdxHelpers.cs for [GeneratedRegex] - Add InternalsVisibleTo for test project - Reorganize ItemGroups with template-style section comments - Add REQ-PLAT-004 for .NET Standard 2.0 target framework support
…evidence Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
test/DemaConsulting.SpdxModel.Tests/DemaConsulting.SpdxModel.Tests.csproj
Outdated
Show resolved
Hide resolved
…erateDocumentationFile Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
|
@copilot I'm being told it's better to add Microsoft.Bcl.HashCode for HashCode.Combine rather than writing a custom polyfill. Additionally the code-quality lint checks failed. |
…-check failures Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Done in d4430a2 — removed the custom |
|
@copilot The Windows build is complaining of: However the PolyFill library looks like it does contain such a method - https://github.com/SimonCropp/Polyfill/blob/88aed47fd70637a830bed2f2747401d9e9a68786/src/Polyfill/Polyfill_String.cs#L167 What gives? |
…n TestHelpers.cs Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Adding |
…rd in TestHelpers.cs Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
|
@copilot The Windows build still failed: |
…ramework and modern .NET Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
... Fixed in 2e2bab3. The root cause is that |
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Syncs with TemplateDotNetLibrary, adds
netstandard2.0as a library target, and usesnet481on Windows CI as direct runtime evidence for that target.Description
Template alignment
LangVersion:12→latestSonarAnalyzer.CSharp→10.20.0.135146,Microsoft.NET.Test.Sdk→18.3.0Polyfill9.12.0(PrivateAssets=All,PolyArgumentExceptions=true) to libraryInternalsVisibleTofor test projectnetstandard2.0supportnetstandard2.0to libraryTargetFrameworksSystem.Text.Json10.0.3 referenced unconditionallyMicrosoft.Bcl.HashCode6.0.0 conditioned onnetstandard2.0forHashCode.Combine[GeneratedRegex]inSpdxHelpers.csguarded behind#if NET7_0_OR_GREATERwith astatic readonly RegexfallbackWindows
net481test targetnet481;net8.0;net9.0;net10.0on Windows,net8.0;net9.0;net10.0elsewherenet481provides direct runtime evidence that thenetstandard2.0library surface works on .NET FrameworkPolyfill +
InternalsVisibleTointeractionPolyfillinjectsinternal static partial class Polyfillinto the library;InternalsVisibleToexposes it to the test project without importing the namespacePolyfilldirectly to the test project caused CS0121 (ambiguous extension methods)<Using Include="Polyfills" />adds a global using — no duplicate package,.ReplaceLineEndings()resolves to the library's compiled copy on all targets includingnet481Portable
ArgumentExceptionassertionsArgumentException.Messageformat differs by runtime:.NET Frameworkappends\r\nParameter name: x; modern .NET appends(Parameter 'x')ex.Messagestring failed onnet481Assert.StartsWith(expectedBaseMessage, ex.Message)+Assert.AreEqual("relationship", ex.ParamName)Requirements
REQ-PLAT-004updated to usenet481@evidenceType of Change
Pre-Submission Checklist
Build and Test
dotnet build --configuration Releasedotnet test --configuration ReleaseCode Quality
dotnet format --verify-no-changesQuality Checks
cspell "**/*.{md,cs}"markdownlint "**/*.md"yamllint .Testing
Documentation
Additional Notes
net481tests run only on Windows CI agents; Linux agents targetnet8.0;net9.0;net10.0.REQ-PLAT-004remains unmet in reqstream until a Windows CI run producesnet481results.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.