From: Jeremy Barton Date: Wed, 26 Aug 2020 16:27:01 +0000 (-0700) Subject: Add netcoreapp build of System.Formats.Asn1 X-Git-Tag: submit/tizen/20210909.063632~5758 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc4715163f907534734adf9b807c55c201451d67;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Add netcoreapp build of System.Formats.Asn1 This avoids the library causing a cyclic dependency in generating netstandard.dll. The netcoreapp version is not included in the NuGet package, following the pattern of * System.Text.Json * System.Collections.Immutable * System.Reflection.Metadata --- diff --git a/src/libraries/System.Formats.Asn1/src/System.Formats.Asn1.csproj b/src/libraries/System.Formats.Asn1/src/System.Formats.Asn1.csproj index f9fdc8c..999a3c5 100644 --- a/src/libraries/System.Formats.Asn1/src/System.Formats.Asn1.csproj +++ b/src/libraries/System.Formats.Asn1/src/System.Formats.Asn1.csproj @@ -2,7 +2,8 @@ true enable - netstandard2.0;net461 + $(NetCoreAppCurrent);netstandard2.0;net461 + true @@ -46,10 +47,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.cs index fbdb8e7..c5e10fd 100644 --- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.cs +++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.cs @@ -730,7 +730,9 @@ namespace System.Formats.Asn1 public void Dispose() { - if (_writer == null || _writer._nestingStack.Count == 0) + Debug.Assert(_writer == null || _writer._nestingStack != null); + + if (_writer == null || _writer._nestingStack!.Count == 0) { return; }