{"id":342573,"date":"2022-12-14T09:02:33","date_gmt":"2022-12-14T09:02:33","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=342573"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=342573","title":{"rendered":"<span>.NET 7: \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/b0b\/9e2\/4f3\/b0b9e24f3484516548fb23b432479a00.png\" alt=\"1015_NET7_Errors_ru\/image1.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/b0b\/9e2\/4f3\/b0b9e24f3484516548fb23b432479a00.png\"\/><\/p>\n<p>  <\/p>\n<p>.NET 7 \u0437\u0430\u0440\u0435\u043b\u0438\u0437\u0438\u043b\u0441\u044f. \u042d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043e\u0432\u043e\u0434 \u043f\u043e\u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430. \u0417\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u043f\u043e \u043d\u0430\u0445\u043e\u0434\u043a\u0430\u043c \u043e\u0431\u0440\u0430\u0442\u0438\u043c\u0441\u044f \u043a \u0441\u0430\u043c\u0438\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c .NET \u2014 \u043a\u043e\u043c\u0443 \u0437\u043d\u0430\u0442\u044c \u043a\u043e\u0434, \u043a\u0430\u043a \u043d\u0435 \u0438\u043c? \u041f\u043e\u0433\u043d\u0430\u043b\u0438! <\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u042f \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b \u0440\u0435\u043b\u0438\u0437\u043d\u044b\u0439 \u043a\u043e\u0434 .NET 7. \u0412\u0437\u044f\u0442\u044c \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430 GitHub: <a href=\"https:\/\/github.com\/dotnet\/runtime\/tree\/v7.0.0\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a>. <\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0440\u0435\u043b\u0438\u0437\u043e\u043c \u0431\u044b\u043b\u043e 2 \u0432\u044b\u043f\u0443\u0441\u043a\u0430 RC (release candidate), \u0430 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0431\u0430\u0433\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u044b. \u041d\u043e \u0442\u0435\u043c \u0434\u0430\u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435, \u043f\u0440\u043e\u0441\u043e\u0447\u0438\u043b\u043e\u0441\u044c \u043b\u0438 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c &#171;\u0432 \u043f\u0440\u043e\u0434&#187;. <\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u044f \u043e\u0442\u043a\u0440\u044b\u043b issue \u043d\u0430 GitHub. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043e\u0448\u0438\u0431\u043e\u0447\u0435\u043d, \u043a\u0430\u043a\u043e\u0439 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u0435\u043d, \u0438 \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u0430\u0432\u043a\u0438 \u0432\u043d\u043e\u0441\u0438\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438.<\/p>\n<p>  <\/p>\n<h3 id=\"issue-1\">Issue 1<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u2014 \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0441 \u043a\u043e\u0434\u043e\u043c \u043d\u0438\u0436\u0435?<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">internal sealed record IncrementalStubGenerationContext(   StubEnvironment Environment,   SignatureContext SignatureContext,   ContainingSyntaxContext ContainingSyntaxContext,   ContainingSyntax StubMethodSyntaxTemplate,   MethodSignatureDiagnosticLocations DiagnosticLocation,   ImmutableArray&lt;AttributeSyntax> ForwardedAttributes,   LibraryImportData LibraryImportData,   MarshallingGeneratorFactoryKey&lt;     (TargetFramework, Version, LibraryImportGeneratorOptions)   > GeneratorFactoryKey,   ImmutableArray&lt;Diagnostic> Diagnostics) {   public bool Equals(IncrementalStubGenerationContext? other)   {     return    other is not null            &amp;&amp; StubEnvironment.AreCompilationSettingsEqual(Environment,                                                            other.Environment)            &amp;&amp; SignatureContext.Equals(other.SignatureContext)            &amp;&amp; ContainingSyntaxContext.Equals(other.ContainingSyntaxContext)            &amp;&amp; StubMethodSyntaxTemplate.Equals(other.StubMethodSyntaxTemplate)            &amp;&amp; LibraryImportData.Equals(other.LibraryImportData)            &amp;&amp; DiagnosticLocation.Equals(DiagnosticLocation)            &amp;&amp; ForwardedAttributes.SequenceEqual(other.ForwardedAttributes,                  (IEqualityComparer&lt;AttributeSyntax>)                   SyntaxEquivalentComparer.Instance)           &amp;&amp; GeneratorFactoryKey.Equals(other.GeneratorFactoryKey)           &amp;&amp; Diagnostics.SequenceEqual(other.Diagnostics);     }      public override int GetHashCode()     {       throw new UnreachableException();     } }<\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041e\u0442\u0432\u0435\u0442<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u041a\u043e\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u0432\u0443\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432: <em>this<\/em> \u0438 <em>other<\/em>. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0443, \u0441\u0440\u0430\u0432\u043d\u0438\u0432 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <em>DiagnosticLocation<\/em> \u0441 \u0441\u043e\u0431\u043e\u0439 \u0436\u0435.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">DiagnosticLocation.Equals(DiagnosticLocation)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">DiagnosticLocation.Equals(other.DiagnosticLocation)<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u042d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u044f \u043d\u0430\u0448\u0451\u043b \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 <em>LibraryImportGenerator<\/em> (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/System.Runtime.InteropServices\/gen\/LibraryImportGenerator\/LibraryImportGenerator.cs#L43\">\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 GitHub<\/a>). \u0427\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u043d\u0430\u0448\u0451\u043b \u0435\u0449\u0451 2 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438, \u043d\u043e \u0443\u0436\u0435 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043a\u043b\u0430\u0441\u0441 <em>JSImportGenerator<\/em>, <a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/System.Runtime.InteropServices.JavaScript\/gen\/JSImportGenerator\/JSImportGenerator.cs#L42\">\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 GitHub<\/a>;<\/li>\n<li>\u043a\u043b\u0430\u0441\u0441 <em>JSExportGenerator<\/em>, <a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/System.Runtime.InteropServices.JavaScript\/gen\/JSImportGenerator\/JSExportGenerator.cs#L37\">\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 GitHub<\/a>. <\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0432 .NET 7 \u043d\u0430 \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0435\u0441\u0442\u044c \u0442\u0435\u0441\u0442. \u0417\u0430\u0433\u0432\u043e\u0437\u0434\u043a\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0435\u0441\u0442 \u0442\u043e\u0436\u0435 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0439 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043d\u0435 \u0432\u044b\u044f\u0432\u043b\u044f\u043b. <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/12d\/0c7\/195\/12d0c719530afda147259266bfe52e9d.png\" alt=\"1015_NET7_Errors_ru\/image2.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/12d\/0c7\/195\/12d0c719530afda147259266bfe52e9d.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0412 .NET 8 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043d, \u0430 \u0434\u043b\u044f .NET 7 \u0444\u0438\u043a\u0441 \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u043b\u0441\u044f. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/github.com\/dotnet\/runtime\/issues\/78145\">issue \u043d\u0430 GitHub<\/a>. <\/p>\n<p>  <\/p>\n<h3 id=\"issue-2\">Issue 2<\/h3>\n<p>  <\/p>\n<pre><code class=\"cs\">internal static void CheckNullable(JSMarshalerType underlyingSig) {     MarshalerType underlying = underlyingSig._signatureType.Type;     if (underlying == MarshalerType.Boolean         || underlying == MarshalerType.Byte         || underlying == MarshalerType.Int16         || underlying == MarshalerType.Int32         || underlying == MarshalerType.BigInt64         || underlying == MarshalerType.Int52         || underlying == MarshalerType.IntPtr         || underlying == MarshalerType.Double         || underlying == MarshalerType.Single \/\/ &lt;=         || underlying == MarshalerType.Single \/\/ &lt;=         || underlying == MarshalerType.Char         || underlying == MarshalerType.DateTime         || underlying == MarshalerType.DateTimeOffset         ) return;     throw new ArgumentException(\"Bad nullable value type\"); }<\/code><\/pre>\n<p>  <\/p>\n<p>Location: JSMarshalerType.cs, 387 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/System.Runtime.InteropServices.JavaScript\/src\/System\/Runtime\/InteropServices\/JavaScript\/JSMarshalerType.cs#L387\">link<\/a>)<\/p>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <em>underlying<\/em> \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e <em>MarshalerType.Single<\/em>. \u0418\u043d\u043e\u0433\u0434\u0430 \u0437\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u043c\u0438 \u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u0438: \u0443\u0441\u043b\u043e\u0432\u043d\u043e, \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 <em>left<\/em> \u0438 <em>right<\/em>, \u043d\u043e \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 <em>left<\/em>. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0438\u0437 Open Source \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441\u043e\u0431\u0440\u0430\u043d\u044b <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/examples\/v3001\/\">\u0437\u0434\u0435\u0441\u044c<\/a>. <\/p>\n<p>  <\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u043b issue \u043d\u0430 GitHub: <a href=\"https:\/\/github.com\/dotnet\/runtime\/issues\/78682\">link<\/a>. \u0412 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0437 .NET 7 \u043f\u043e\u0432\u0435\u0437\u043b\u043e \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0439.<\/p>\n<p>  <\/p>\n<h3 id=\"issue-3\">Issue 3<\/h3>\n<p>  <\/p>\n<pre><code class=\"cs\">public static bool TryParse(string text, out MetricSpec spec) {   int slashIdx = text.IndexOf(MeterInstrumentSeparator);   if (slashIdx == -1)   {     spec = new MetricSpec(text.Trim(), null);     return true;   }   else   {     string meterName = text.Substring(0, slashIdx).Trim();     string? instrumentName = text.Substring(slashIdx + 1).Trim();     spec = new MetricSpec(meterName, instrumentName);     return true;   } }<\/code><\/pre>\n<p>  <\/p>\n<p>Location: MetricsEventSource.cs, 453 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/System.Diagnostics.DiagnosticSource\/src\/System\/Diagnostics\/Metrics\/MetricsEventSource.cs#L453\">link<\/a>)<\/p>\n<p>  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 <em>TryParse<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2013 <em>true<\/em>. \u042d\u0442\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0433\u0434\u0435 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">private void ParseSpecs(string? metricsSpecs) {   ....   string[] specStrings = ....   foreach (string specString in specStrings)   {     if (!MetricSpec.TryParse(specString, out MetricSpec spec))     {       Log.Message($\"Failed to parse metric spec: {specString}\");     }     else     {       Log.Message($\"Parsed metric: {spec}\");       ....     }   } }<\/code><\/pre>\n<p>  <\/p>\n<p>Location: MetricsEventSource.cs, 375 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/System.Diagnostics.DiagnosticSource\/src\/System\/Diagnostics\/Metrics\/MetricsEventSource.cs#L375\">link<\/a>) <\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <em>TryParse<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>if<\/em>. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 <em>specString<\/em>, \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u0418\u043d\u0430\u0447\u0435 \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u2014 <em>spec<\/em> \u2014, \u0438 \u043d\u0430\u0434 \u043d\u0438\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0435\u0449\u0451 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438. <\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <em>TryParse<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <em>true.<\/em> \u0417\u043d\u0430\u0447\u0438\u0442, then-\u0432\u0435\u0442\u0432\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>if<\/em> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u043c.<\/p>\n<p>  <\/p>\n<p>Issue \u043d\u0430 GitHub: <a href=\"https:\/\/github.com\/dotnet\/runtime\/issues\/78625\">link<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f <em>TryParse<\/em> \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0432 <em>Parse<\/em>, \u0430 \u0432 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043f\u0440\u043e\u043f\u0430\u043b \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>if<\/em>. \u0412 <em>TryParse<\/em> \u0437\u0430\u043e\u0434\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438 <em>Substring<\/em> \u043d\u0430 <em>AsSpan<\/em>.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/e51\/268\/f29\/e51268f29787a6b8e1244c12814b7d14.png\" alt=\"1015_NET7_Errors_ru\/image3.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/e51\/268\/f29\/e51268f29787a6b8e1244c12814b7d14.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u044d\u0442\u043e\u0442 \u0436\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u044f \u043e\u0442\u043c\u0435\u0447\u0430\u043b \u0432 \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u043f\u0430\u043b\u0441\u044f \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 .NET 6. \u0422\u043e\u0433\u0434\u0430 \u0432 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u044b\u043b \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d \u0441\u0438\u043c\u0432\u043e\u043b \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">if (!MetricSpec.TryParse(specString, out MetricSpec spec)) {   Log.Message(\"Failed to parse metric spec: {specString}\"); } else {   Log.Message(\"Parsed metric: {spec}\");   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u044d\u0442\u0443 \u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0903\/\">\u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 .NET 6<\/a> (issue 14). <\/p>\n<p>  <\/p>\n<h3 id=\"issue-4\">Issue 4<\/h3>\n<p>  <\/p>\n<p>\u0420\u0430\u0437 \u0443\u0436 \u043c\u044b \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u043b\u0438 \u0442\u0435\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public virtual bool TryAdd(XmlDictionaryString value, out int key) {   ArgumentNullException.ThrowIfNull(value);    IntArray? keys;    if (_maps.TryGetValue(value.Dictionary, out keys))   {     key = (keys[value.Key] - 1);      if (key != -1)     {       \/\/ If the key is already set, then something is wrong       throw System.Runtime                   .Serialization                   .DiagnosticUtility                   .ExceptionUtility                   .ThrowHelperError(       new InvalidOperationException(SR.XmlKeyAlreadyExists));      }       key = Add(value.Value);      keys[value.Key] = (key + 1);      return true;               \/\/ &lt;=   }    key = Add(value.Value);   keys = AddKeys(value.Dictionary, value.Key + 1);   keys[value.Key] = (key + 1);   return true;                  \/\/ &lt;= }<\/code><\/pre>\n<p>  <\/p>\n<p>Location: XmlBinaryWriterSession.cs, 28 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/System.Private.DataContractSerialization\/src\/System\/Xml\/XmlBinaryWriterSession.cs#L28\">link<\/a>)<\/p>\n<p>  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 \u0438\u043b\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <em>true<\/em>, \u0438\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u043d\u043e \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <em>false<\/em>. \u042d\u0442\u043e \u0443\u0436\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 API, \u0442\u0430\u043a \u0447\u0442\u043e \u0438 \u0441\u043f\u0440\u043e\u0441\u0430 \u0431\u043e\u043b\u044c\u0448\u0435. <\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0430 <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/system.xml.xmlbinarywritersession.tryadd?view=net-7.0\">learn.microsoft.com<\/a>:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/8a\/rq\/av\/8arqavhuvmdx2iqmzvnoe_mkjoy.png\" alt=\"1015_NET7_Errors_ru\/image4.png\" data-src=\"https:\/\/habrastorage.org\/webt\/8a\/rq\/av\/8arqavhuvmdx2iqmzvnoe_mkjoy.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041d\u0435\u0441\u0442\u044b\u043a\u043e\u0432\u043e\u0447\u043a\u0430. \u042f \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u043a\u0440\u044b\u043b issue \u043d\u0430 GitHub (<a href=\"https:\/\/github.com\/dotnet\/dotnet-api-docs\/issues\/8656\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a>), \u043d\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u043e\u0432\u043e\u0441\u0442\u0435\u0439 \u043d\u0435 \u0431\u044b\u043b\u043e.<\/p>\n<p>  <\/p>\n<h3 id=\"issue-5\">Issue 5<\/h3>\n<p>  <\/p>\n<pre><code class=\"cs\">public static Attribute? GetCustomAttribute(ParameterInfo element,                                              Type attributeType,                                              bool inherit) {   \/\/ ....   Attribute[] attrib = GetCustomAttributes(element, attributeType, inherit);    if (attrib == null || attrib.Length == 0)     return null;    if (attrib.Length == 0)     return null;    if (attrib.Length == 1)     return attrib[0];    throw new AmbiguousMatchException(SR.RFLCT_AmbigCust); }<\/code><\/pre>\n<p>  <\/p>\n<p>Location: Attribute.CoreCLR.cs, 617 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/coreclr\/System.Private.CoreLib\/src\/System\/Attribute.CoreCLR.cs#L617\">link<\/a>)<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430 2 \u0440\u0430\u0437\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u2014 <em>attrib.Length == 0<\/em>: \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &#8216;||&#8217;, \u0437\u0430\u0442\u0435\u043c \u043a\u0430\u043a \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>if<\/em>. <\/p>\n<p>  <\/p>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043e\u0448\u0438\u0431\u043a\u0438 \u2014 \u0445\u043e\u0442\u0435\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043e\u0434\u043d\u043e, \u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0435. \u0417\u0434\u0435\u0441\u044c \u043f\u043e\u0432\u0435\u0437\u043b\u043e: \u0432\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0439, \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0435\u0451 \u0443\u0431\u0440\u0430\u043b\u0438.<\/p>\n<p>  <\/p>\n<p>Issue \u043d\u0430 GitHub: <a href=\"https:\/\/github.com\/dotnet\/runtime\/issues\/78683\">link<\/a>. <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/c0a\/e51\/ef6\/c0ae51ef6b334f54ebffb0b89f8bcb97.png\" alt=\"1015_NET7_Errors_ru\/image5.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/c0a\/e51\/ef6\/c0ae51ef6b334f54ebffb0b89f8bcb97.png\"\/><\/p>\n<p>  <\/p>\n<h3 id=\"issue-6\">Issue 6<\/h3>\n<p>  <\/p>\n<pre><code class=\"cs\">protected virtual XmlSchema? GetSchema() {   if (GetType() == typeof(DataTable))   {     return null;   }   MemoryStream stream = new MemoryStream();    XmlWriter writer = new XmlTextWriter(stream, null);   if (writer != null)   {     (new XmlTreeGen(SchemaFormat.WebService)).Save(this, writer);   }   stream.Position = 0;   return XmlSchema.Read(new XmlTextReader(stream), null); }<\/code><\/pre>\n<p>  <\/p>\n<p>Location: DataTable.cs, 6678 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/System.Data.Common\/src\/System\/Data\/DataTable.cs#L6678\">link<\/a>)<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u043b\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0442\u0438\u043f\u0430 <em>XmlTextWriter<\/em>, \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043d\u0435\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <em>writer<\/em> \u0438 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u0435\u0451 \u043d\u0430 \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e <em>null<\/em>. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u0432\u0430\u0442\u044c <em>true<\/em>, \u0437\u043d\u0430\u0447\u0438\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0434\u0435\u0441\u044c \u043b\u0438\u0448\u043d\u0435\u0435. <\/p>\n<p>  <\/p>\n<p>\u041d\u0435\u0441\u0442\u0440\u0430\u0448\u043d\u043e, \u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0440\u0430\u0442\u044c. \u0422\u0430\u043a \u0438 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/issues\/78684\">issue \u043d\u0430 GitHub<\/a>):<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/694\/efd\/e0e\/694efde0ea66a2532cd251cd6e1de7d8.png\" alt=\"1015_NET7_Errors_ru\/image6.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/694\/efd\/e0e\/694efde0ea66a2532cd251cd6e1de7d8.png\"\/><\/p>\n<p>  <\/p>\n<h3 id=\"issue-7\">Issue 7<\/h3>\n<p>  <\/p>\n<p>\u0422\u043e\u0436\u0435 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u043e \u0447\u0443\u0442\u044c \u043c\u0435\u043d\u0435\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0439.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public int ToFourDigitYear(int year, int twoDigitYearMax) {   if (year &lt; 0)   {     throw new ArgumentOutOfRangeException(nameof(year),                                            SR.ArgumentOutOfRange_NeedPosNum);   }    if (year &lt; 100)   {     int y = year % 100;     return (twoDigitYearMax \/ 100 - (y > twoDigitYearMax % 100 ? 1 : 0))               * 100 + y;   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>Location: GregorianCalendarHelper.cs, 526 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/System.Private.CoreLib\/src\/System\/Globalization\/GregorianCalendarHelper.cs#L526\">link<\/a>)<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0441\u043b\u0435\u0434\u0438\u043c \u0437\u0430 \u0442\u0435\u043c, \u043a\u0430\u043a \u0443\u0442\u043e\u0447\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>year<\/em> \u043f\u043e \u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">ToFourDigitYear(int year, int twoDigitYearMax)<\/code><\/pre>\n<p>  <\/p>\n<p><em>year<\/em> \u2013 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043c\u0435\u0442\u043e\u0434\u0430 \u0442\u0438\u043f\u0430 <em>int.<\/em> \u0417\u043d\u0430\u0447\u0438\u0442, \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 [<em>int.MinValue<\/em>; <em>int.MaxValue<\/em>]. <\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>if<\/em>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">if (year &lt; 0) {   throw ....; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e, \u0437\u043d\u0430\u0447\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>year<\/em> \u043b\u0435\u0436\u0438\u0442 \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 [0; <em>int.MaxValue<\/em>]. <\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>if<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">if (year &lt; 100) {   int y = year % 100;   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0437\u0430\u0448\u043b\u043e \u0432 then-\u0432\u0435\u0442\u0432\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>if<\/em>, \u0437\u043d\u0430\u0447\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>year<\/em> \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 [0; 99]. \u042d\u0442\u043e \u0443\u0436\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0437\u044f\u0442\u0438\u044f \u043e\u0441\u0442\u0430\u0442\u043a\u0430 \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">int y = year % 100;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>year<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u0435\u043d\u044c\u0448\u0435 100 (\u043e\u0442 0 \u0434\u043e 99). \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 <em>year % 100<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u0435\u043d \u043b\u0435\u0432\u043e\u043c\u0443 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0443 \u2013 <em>year<\/em>. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e <em>y<\/em> \u0438 <em>year<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0430\u0432\u043d\u044b. <\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u043e\u0433\u043e, \u0438\u043b\u0438 \u043a\u043e\u0434 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0439, \u0438\u043b\u0438 \u0437\u0434\u0435\u0441\u044c \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430. \u041e\u0442\u043a\u0440\u044b\u043b <a href=\"https:\/\/github.com\/dotnet\/runtime\/issues\/78627\">issue \u043d\u0430 GitHub<\/a>: \u043a\u043e\u0434 \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043b\u0438, \u0443\u0431\u0440\u0430\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <em>y<\/em>. <\/p>\n<p>  <\/p>\n<h3 id=\"issue-8\">Issue 8<\/h3>\n<p>  <\/p>\n<pre><code class=\"cs\">internal ConfigurationSection FindImmediateParentSection(ConfigurationSection section) {   ....   SectionRecord sectionRecord = ....   if (sectionRecord.HasLocationInputs)   {     SectionInput input = sectionRecord.LastLocationInput;     Debug.Assert(input.HasResult, \"input.HasResult\");     result = (ConfigurationSection)input.Result;   }   else   {     if (sectionRecord.HasIndirectLocationInputs)     {       Debug.Assert(IsLocationConfig,                     \"Indirect location inputs exist                      only in location config record\");       SectionInput input = sectionRecord.LastIndirectLocationInput;       Debug.Assert(input != null);       Debug.Assert(input.HasResult, \"input.HasResult\");       result = (ConfigurationSection)input.Result;     }     ....   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>Location: MgmtConfigurationRecord.cs, 341 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/System.Configuration.ConfigurationManager\/src\/System\/Configuration\/MgmtConfigurationRecord.cs#L341\">link<\/a>)<\/p>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u043e\u0437\u0438\u0442\u044c\u0441\u044f. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>if<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">if (sectionRecord.HasIndirectLocationInputs) {   Debug.Assert(IsLocationConfig,                 \"Indirect location inputs exist                  only in location config record\");   SectionInput input = sectionRecord.LastIndirectLocationInput;   Debug.Assert(input != null);   Debug.Assert(input.HasResult, \"input.HasResult\");   result = (ConfigurationSection)input.Result; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <em>input<\/em> \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <em>LastIndirectLocationInput.<\/em> \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e <em>input<\/em> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0432 \u0434\u0432\u0443\u0445 \u0430\u0441\u0441\u0435\u0440\u0442\u0430\u0445: \u043d\u0430 <em>null<\/em> (<em>input != null<\/em>) \u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 (<em>input.HasResult<\/em>). <\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0442\u0435\u043b\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <em>LastIndirectLocationInput, <\/em>\u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <em>input<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">internal SectionInput LastIndirectLocationInput   =>   HasIndirectLocationInputs       ? IndirectLocationInputs[IndirectLocationInputs.Count - 1]       : null;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u2014 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 <em>HasIndirectLocationInputs<\/em> \u2014 <em>true<\/em>, \u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f <em>IndirectLocationInputs[IndirectLocationInputs.Count \u2014 1]<\/em>, \u0430 \u043d\u0435 \u044f\u0432\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>. <\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u043f\u0440\u043e\u0441 \u0432\u043e\u0442 \u0432 \u0447\u0451\u043c \u2014 \u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 <em>IndirectLocationInputs<\/em> \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u043e <em>null<\/em>? \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u2014 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u041a\u0441\u0442\u0430\u0442\u0438, \u0442\u0443\u0442 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043f\u043e\u043c\u043e\u0447\u044c nullable-\u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438, \u043d\u043e \u043e\u043d\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043d\u0435 \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 .NET. <\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0432 <em>if<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">if (sectionRecord.HasIndirectLocationInputs) {   Debug.Assert(IsLocationConfig,                 \"Indirect location inputs exist                  only in location config record\");   SectionInput input = sectionRecord.LastIndirectLocationInput;   Debug.Assert(input != null);   Debug.Assert(input.HasResult, \"input.HasResult\");   result = (ConfigurationSection)input.Result; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423\u0441\u043b\u043e\u0432\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u2014 <em>sectionRecord.HasIndirectLocationInputs. <\/em>\u042d\u0442\u043e \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0432 <em>LastIndirectLocationInput<\/em>. \u0417\u043d\u0430\u0447\u0438\u0442, <em>LastIndirectLocationInput<\/em> \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044f\u0432\u043d\u044b\u0439 <em>null<\/em>. \u041e\u0434\u043d\u0430\u043a\u043e \u043a\u0430\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043e \u0438\u0437 <em>IndirectLocationInputs<\/em> \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <em>input<\/em> \u2014 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442, \u0447\u0442\u043e <em>input != null<\/em>, \u0438 \u043b\u0438\u0448\u044c \u0437\u0430\u0442\u0435\u043c \u0441\u043c\u043e\u0442\u0440\u044f\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u2014 <em>input.HasResult<\/em>. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e. <\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>if<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">if (sectionRecord.HasLocationInputs) {   SectionInput input = sectionRecord.LastLocationInput;   Debug.Assert(input.HasResult, \"input.HasResult\");   result = (ConfigurationSection)input.Result; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <em>LastLocationInput<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">internal SectionInput LastLocationInput    =>  HasLocationInputs      ? LocationInputs[LocationInputs.Count - 1]      : null;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043f\u043e \u0442\u043e\u043c\u0443 \u0436\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443, \u0447\u0442\u043e \u0438 <em>LastIndirectLocationInput<\/em>. \u041a\u0430\u043a \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0444\u043b\u0430\u0433\u0430 (<em>HasLocationInputs<\/em>) \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0438\u043b\u0438 <em>null<\/em>, \u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 <em>LocationInputs<\/em>. <\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0443 <em>if<\/em>. \u0415\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u2014 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <em>HasLocationInputs<\/em>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0438 \u0432\u043d\u0443\u0442\u0440\u0438 <em>LastLocationInput<\/em>. \u0415\u0441\u043b\u0438 \u0437\u0430\u0448\u043b\u0438 \u0432 \u0442\u0435\u043b\u043e <em>if<\/em>, \u0437\u043d\u0430\u0447\u0438\u0442 <em>LastLocationInput<\/em> \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u044f\u0432\u043d\u044b\u0439 <em>null<\/em>. \u041c\u043e\u0436\u0435\u0442 \u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 <em>LocationInputs<\/em> \u0431\u044b\u0442\u044c <em>null<\/em>? \u0412\u043e\u043f\u0440\u043e\u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439. \u0415\u0441\u043b\u0438 \u043c\u043e\u0436\u0435\u0442, \u0442\u043e \u0438 \u0432 <em>input<\/em> \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d <em>null<\/em>. <\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043f\u0435\u0440\u0432\u044b\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u043c <em>if<\/em>, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <em>input.HasResult<\/em>, \u0430 \u0432\u043e\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <em>input != null<\/em> \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442. <\/p>\n<p>  <\/p>\n<p>\u0415\u0449\u0451 \u0440\u0430\u0437. \u041f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430: <\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">SectionInput input = sectionRecord.LastIndirectLocationInput; Debug.Assert(input != null); Debug.Assert(input.HasResult, \"input.HasResult\"); result = (ConfigurationSection)input.Result;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">SectionInput input = sectionRecord.LastLocationInput; Debug.Assert(input.HasResult, \"input.HasResult\"); result = (ConfigurationSection)input.Result;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a, \u0431\u0443\u0434\u0442\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <em>Debug.Assert(input != null)<\/em>.<\/p>\n<p>  <\/p>\n<p>\u042f \u043e\u0442\u043a\u0440\u044b\u043b <a href=\"https:\/\/github.com\/dotnet\/runtime\/issues\/78634\">issue \u043d\u0430 GitHub<\/a>, \u0433\u0434\u0435 \u043e\u043f\u0438\u0441\u0430\u043b \u044d\u0442\u043e \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 <em>null<\/em>-\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u043c\u0438 (\u0438\u0445 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0438\u0436\u0435). <\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0435 \u0441\u0442\u0430\u043b\u0438, \u043e\u0441\u0442\u0430\u0432\u0438\u0432 as is:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/afe\/348\/20e\/afe34820e065634265201c465833577c.png\" alt=\"1015_NET7_Errors_ru\/image7.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/afe\/348\/20e\/afe34820e065634265201c465833577c.png\"\/><\/p>\n<p>  <\/p>\n<h3 id=\"issues-c-proverkoy-na-null\">Issues c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u043d\u0430 null<\/h3>\n<p>  <\/p>\n<p>\u0412 \u043a\u043e\u0434\u0435 \u044f \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0441\u044b\u043b\u043a\u0430 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>null.<\/em> \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043b\u043e\u0434\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438, \u0441\u043e\u0431\u0440\u0430\u043b \u0438\u0445 \u0432\u0441\u0435 \u0432 \u043e\u0431\u0449\u0435\u043c <a href=\"https:\/\/github.com\/dotnet\/runtime\/issues\/78634\">issue \u043d\u0430 GitHub<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u044d\u0442\u0438 \u043c\u0435\u0441\u0442\u0430. <\/p>\n<p>  <\/p>\n<h3 id=\"issue-9\">Issue 9<\/h3>\n<p>  <\/p>\n<pre><code class=\"cs\">private static RuntimeBinderException BadOperatorTypesError(Expr pOperand1,                                                              Expr pOperand2) {   \/\/ ....   string strOp = pOperand1.ErrorString;    Debug.Assert(pOperand1 != null);   Debug.Assert(pOperand1.Type != null);    if (pOperand2 != null)   {     Debug.Assert(pOperand2.Type != null);     return ErrorHandling.Error(ErrorCode.ERR_BadBinaryOps,                                strOp,                                 pOperand1.Type,                                 pOperand2.Type);   }    return ErrorHandling.Error(ErrorCode.ERR_BadUnaryOp, strOp, pOperand1.Type); }<\/code><\/pre>\n<p>  <\/p>\n<p>Location: ExpressionBinder.cs, 798 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/Microsoft.CSharp\/src\/Microsoft\/CSharp\/RuntimeBinder\/Semantics\/ExpressionBinder.cs#L798\">link<\/a>)<\/p>\n<p>  <\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 <em>pOperand1<\/em> \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f (<em>pOperand1.ErrorString<\/em>), \u0430 \u0443\u0436\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>null<\/em> \u0432 <em>Debug.Assert<\/em>. \u0415\u0441\u043b\u0438 <em>pOperand1<\/em> \u0431\u0443\u0434\u0435\u0442 <em>null<\/em>, \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0430\u0441\u0441\u0435\u0440\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 <em>NullReferenceException<\/em>. <\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043b\u0438, \u0432\u044b\u043d\u0435\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 <em>pOperand1<\/em> \u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. <\/p>\n<p>  <\/p>\n<p>\u0411\u044b\u043b\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">string strOp = pOperand1.ErrorString;  Debug.Assert(pOperand1 != null); Debug.Assert(pOperand1.Type != null);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u0442\u0430\u043b\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">Debug.Assert(pOperand1 != null); Debug.Assert(pOperand1.Type != null);  string strOp = pOperand1.ErrorString;<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"issue-10\">Issue 10<\/h3>\n<p>  <\/p>\n<pre><code class=\"cs\">public void Execute() {   var count = _callbacks.Count;   if (count == 0)   {     return;   }    List&lt;Exception>? exceptions = null;    if (_callbacks != null)   {     for (int i = 0; i &lt; count; i++)     {       var callback = _callbacks[i];       Execute(callback, ref exceptions);     }   }    if (exceptions != null)   {     throw new AggregateException(exceptions);   } }<\/code><\/pre>\n<p>  <\/p>\n<p>Location: PipeCompletionCallbacks.cs, 20 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/System.IO.Pipelines\/src\/System\/IO\/Pipelines\/PipeCompletionCallbacks.cs#L20\">link<\/a>)<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <em>_callbacks<\/em> \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u0435\u0451 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e <em>null<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public void Execute() {   var count = _callbacks.Count;   ....   if (_callbacks != null)   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043a\u043e\u0434 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438, \u0443\u0431\u0440\u0430\u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 <em>_callbacks<\/em> \u043d\u0430 <em>null<\/em>. <\/p>\n<p>  <\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, <em>_callbacks<\/em> \u2013 \u044d\u0442\u043e <em>readonly<\/em> \u043f\u043e\u043b\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">internal sealed class PipeCompletionCallbacks {   private readonly List&lt;PipeCompletionCallback> _callbacks;   private readonly Exception? _exception;   public PipeCompletionCallbacks(List&lt;PipeCompletionCallback> callbacks,                                   ExceptionDispatchInfo? edi)   {     _callbacks = callbacks;     _exception = edi?.SourceException;   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0442\u0440\u0435\u0434\u0435 \u0441 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u043b\u0438, \u0441\u0442\u043e\u0438\u0442 \u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 <em>Debug.Assert<\/em> \u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 <em>_callbacks<\/em> \u043d\u0430 <em>null<\/em>. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0440\u0435\u0448\u0438\u043b\u0438 \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/552\/286\/09b\/55228609b7b3899af4950dd31c7b48f3.png\" alt=\"1015_NET7_Errors_ru\/image8.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/552\/286\/09b\/55228609b7b3899af4950dd31c7b48f3.png\"\/><\/p>\n<p>  <\/p>\n<h3 id=\"issue-11\">Issue 11<\/h3>\n<p>  <\/p>\n<pre><code class=\"cs\">private void ValidateAttributes(XmlElement elementNode) {   ....   XmlSchemaAttribute schemaAttribute      = (_defaultAttributes[i] as XmlSchemaAttribute)!;   attrQName = schemaAttribute.QualifiedName;   Debug.Assert(schemaAttribute != null);   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>Location: DocumentSchemaValidator.cs, 421 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/System.Private.Xml\/src\/System\/Xml\/Dom\/DocumentSchemaValidator.cs#L421\">link<\/a>)<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0432\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>as<\/em> \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 <em>schemaAttribute<\/em>. \u0415\u0441\u043b\u0438 <em>_defaultAttributes[i]<\/em> \u2014 <em>null<\/em>, \u0438\u043b\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 <em>null<\/em>. <\/li>\n<li>null-forgiving \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 (&#8216;!&#8217;) \u043d\u0430\u043c\u0435\u043a\u0430\u0435\u0442, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <em>null<\/em>. \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, <em>schemaAttribute<\/em> \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u0435\u043d <em>null<\/em>. <\/li>\n<li>\u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 <em>schemaAttribute<\/em> \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f. \u0415\u0449\u0451 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u043d\u0438\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0435 \u0440\u0430\u0432\u043d\u0430 <em>null<\/em>.<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0432\u043e\u043f\u0440\u043e\u0441. \u041c\u043e\u0436\u0435\u0442 \u043b\u0438 <em>schemaAttribute<\/em> \u0438\u043c\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>? \u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e. <\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u043a\u043e\u0434 \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">.... XmlSchemaAttribute schemaAttribute    = (XmlSchemaAttribute)_defaultAttributes[i]!; attrQName = schemaAttribute.QualifiedName; ....<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0438 \u043f\u0440\u0430\u0432\u043e\u043a \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u043b\u0438 \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0432\u044b\u0437\u043e\u0432 <em>Debug.Assert<\/em>, \u0430 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0435\u0433\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0432\u044b\u0448\u0435. \u041a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u0431\u044b \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">.... XmlSchemaAttribute schemaAttribute = (XmlSchemaAttribute)_defaultAttributes[i]!; Debug.Assert(schemaAttribute != null); attrQName = schemaAttribute.QualifiedName; ....<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 <em>Assert<\/em> \u0440\u0435\u0448\u0438\u043b\u0438 \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/4f6\/47c\/879\/4f647c879bc918d9ba709bcec8f0db5b.png\" alt=\"1015_NET7_Errors_ru\/image9.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/4f6\/47c\/879\/4f647c879bc918d9ba709bcec8f0db5b.png\"\/><\/p>\n<p>  <\/p>\n<h3 id=\"issue-12\">Issue 12<\/h3>\n<p>  <\/p>\n<p>\u0412\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0442\u0438\u043f\u0430 <em>XmlConfigurationElementTextContent<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public XmlConfigurationElementTextContent(string textContent,                                            int? linePosition,                                            int? lineNumber) { .... }<\/code><\/pre>\n<p>  <\/p>\n<p>Location: XmlConfigurationElementTextContent.cs, 10 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/Microsoft.Extensions.Configuration.Xml\/src\/XmlConfigurationElementTextContent.cs#L10\">link<\/a>)<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0433\u0434\u0435 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static IDictionary&lt;string, string?> Read(....) {   ....   case XmlNodeType.EndElement:     ....     var lineInfo = reader as IXmlLineInfo;     var lineNumber = lineInfo?.LineNumber;     var linePosition = lineInfo?.LinePosition;     parent.TextContent = new XmlConfigurationElementTextContent(string.Empty,                                                                  lineNumber,                                                                 linePosition);     ....     break;   ....   case XmlNodeType.Text:     ....     var lineInfo = reader as IXmlLineInfo;     var lineNumber = lineInfo?.LineNumber;     var linePosition = lineInfo?.LinePosition;      XmlConfigurationElement parent = currentPath.Peek();      parent.TextContent = new XmlConfigurationElementTextContent(reader.Value,                                                                 lineNumber,                                                                  linePosition);     ....     break;   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>Locations:<\/p>\n<p>  <\/p>\n<ul>\n<li>XmlStreamConfigurationProvider.cs, 133 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/Microsoft.Extensions.Configuration.Xml\/src\/XmlStreamConfigurationProvider.cs#L133\">link<\/a>)<\/li>\n<li>XmlStreamConfigurationProvider.cs, 148 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/Microsoft.Extensions.Configuration.Xml\/src\/XmlStreamConfigurationProvider.cs#L148\">link<\/a>) <\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0417\u0430\u043c\u0435\u0442\u0438\u043b\u0438 \u043f\u043e\u0434\u0432\u043e\u0445 \u0432 \u043a\u043e\u0434\u0435? <\/p>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b: &#8230;, <em>lineNumber<\/em>, <em>linePosition<\/em>; <\/li>\n<li>\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b: &#8230;, <em>linePosition<\/em>, <em>lineNumber<\/em>.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u042f \u043e\u0442\u043a\u0440\u044b\u043b issue \u043d\u0430 GitHub (<a href=\"https:\/\/github.com\/dotnet\/runtime\/issues\/78212\">link<\/a>), \u043a\u043e\u0434 \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043b\u0438: \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438 \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0442\u0435\u0441\u0442. <\/p>\n<p>  <\/p>\n<h3 id=\"issue-13\">Issue 13<\/h3>\n<p>  <\/p>\n<p>\u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439: <\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public virtual bool Nested {   get {....}   set    {     ....     ForeignKeyConstraint? constraint        = ChildTable.Constraints                   .FindForeignKeyConstraint(ChildKey.ColumnsReference,                                              ParentKey.ColumnsReference);      ....   } }<\/code><\/pre>\n<p>  <\/p>\n<p>Location: DataRelation.cs, 486 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/System.Data.Common\/src\/System\/Data\/DataRelation.cs#L486\">link<\/a>)<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043c\u0435\u0442\u043e\u0434 <em>FindForeignKeyConstraint<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">internal ForeignKeyConstraint?  FindForeignKeyConstraint(DataColumn[] parentColumns,                           DataColumn[] childColumns) { .... }<\/code><\/pre>\n<p>  <\/p>\n<p>Location: ConstraintCollection.cs, 548 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/System.Data.Common\/src\/System\/Data\/ConstraintCollection.cs#L548\">link<\/a>)<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435, \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u043f\u044f\u0442\u044c \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b: <em>parent<\/em>&#8230;, <em>child<\/em>&#8230;<\/li>\n<li>\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b: <em>ChildKey<\/em>&#8230;, <em>ParentKey<\/em>&#8230;<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0432\u044b\u0437\u043e\u0432 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430: \u0442\u0430\u043c \u043a \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. <\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">ForeignKeyConstraint? foreignKey   = relation.ChildTable             .Constraints             .FindForeignKeyConstraint(relation.ParentColumnsReference,                                       relation.ChildColumnsReference);<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u043b issue \u043d\u0430 GitHub: <a href=\"https:\/\/github.com\/dotnet\/runtime\/issues\/78628\">link<\/a>. \u0423\u0432\u044b, \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434\u0443. <\/p>\n<p>  <\/p>\n<h3 id=\"issue-14\">Issue 14<\/h3>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u043d\u0435 \u0432\u0441\u0435 \u043c\u0435\u0441\u0442\u0430, \u0433\u0434\u0435 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u043d \u2014 \u043d\u0430\u0448\u0451\u043b \u0435\u0449\u0451 \u043e\u0434\u043d\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">void RecurseChildren(....) {   ....   string? value      =  processValue != null       ? processValue(new ConfigurationDebugViewContext(                            child.Key,                             child.Path,                             valueAndProvider.Value,                             valueAndProvider.Provider))       : valueAndProvider.Value;    .... }<\/code><\/pre>\n<p>  <\/p>\n<p>Location: ConfigurationRootExtensions.cs, 50 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/Microsoft.Extensions.Configuration.Abstractions\/src\/ConfigurationRootExtensions.cs#L50\">link<\/a>)<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 <em>ConfigurationDebugViewContext<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public ConfigurationDebugViewContext(   string path,    string key,    string? value,    IConfigurationProvider configurationProvider)  { .... }<\/code><\/pre>\n<p>  <\/p>\n<p>Location: ConfigurationDebugViewContext.cs, 11 (<a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/d099f075e45d2aa6007a22b71b45a08758559f80\/src\/libraries\/Microsoft.Extensions.Configuration.Abstractions\/src\/ConfigurationDebugViewContext.cs#L11\">link<\/a>)<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b: <em>path<\/em>, <em>key<\/em>, &#8230;<\/li>\n<li>\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b: <em>child.Key<\/em>, <em>child.Path<\/em>, &#8230;<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u043b issue \u043d\u0430 GitHub: <a href=\"https:\/\/github.com\/dotnet\/runtime\/issues\/78306\">link<\/a>. \u0421\u043e \u0441\u043b\u043e\u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0443, \u044d\u0442\u043e\u0442 \u043a\u0435\u0439\u0441 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u043b \u043f\u0440\u043e\u0431\u043b\u0435\u043c. <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/fde\/1a7\/4cd\/fde1a74cd4d5f43ab8438b7566979d55.png\" alt=\"1015_NET7_Errors_ru\/image10.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/fde\/1a7\/4cd\/fde1a74cd4d5f43ab8438b7566979d55.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438 \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439.<\/p>\n<p>  <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 .NET 7 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430. \u042f \u0434\u0443\u043c\u0430\u044e, \u044d\u0442\u043e\u043c\u0443 \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043d\u0430\u043b\u0430\u0436\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438: \u0434\u0430\u0442\u044b \u0440\u0435\u043b\u0438\u0437\u043e\u0432 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b, \u0432\u044b\u043f\u0443\u0441\u043a\u0438 RC \u0442\u043e\u0436\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0435 \u0437\u0440\u044f.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0447\u0442\u043e-\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0444\u0430\u0432\u043e\u0440\u0438\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0441\u0442\u0430\u043b\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0430\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. <\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u044f \u043d\u0430\u0448\u0451\u043b \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c PVS-Studio. \u0414\u0430, \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043d\u0430 .NET 7. <\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 (\u043b\u0438\u0447\u043d\u044b\u0439 \u0438\u043b\u0438 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0439), \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441 <a href=\"https:\/\/pvs-studio.com\/ru\/pvs-studio\/try-free\/?utm_source=website&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=1015&amp;utm_term=link_try-free\">\u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b<\/a>. \u0422\u0430\u043c \u0436\u0435 \u0435\u0441\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e: \u0432 \u043d\u0435\u0439 \u043c\u044b \u043e\u043f\u0438\u0441\u0430\u043b\u0438, \u043a\u0430\u043a \u0432\u0432\u0435\u0441\u0442\u0438 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044e \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437. \u0415\u0441\u043b\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0438\u043b\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u2014 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e <a href=\"https:\/\/pvs-studio.com\/ru\/about-feedback\/\">\u043f\u0438\u0448\u0438\u0442\u0435 \u043d\u0430\u043c<\/a>, \u043f\u043e\u043c\u043e\u0436\u0435\u043c.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/705364\/\"> https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/705364\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/b0b\/9e2\/4f3\/b0b9e24f3484516548fb23b432479a00.png\" alt=\"1015_NET7_Errors_ru\/image1.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/b0b\/9e2\/4f3\/b0b9e24f3484516548fb23b432479a00.png\"\/><\/p>\n<p>  <\/p>\n<p>.NET 7 \u0437\u0430\u0440\u0435\u043b\u0438\u0437\u0438\u043b\u0441\u044f. \u042d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043e\u0432\u043e\u0434 \u043f\u043e\u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430. \u0417\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u043f\u043e \u043d\u0430\u0445\u043e\u0434\u043a\u0430\u043c \u043e\u0431\u0440\u0430\u0442\u0438\u043c\u0441\u044f \u043a \u0441\u0430\u043c\u0438\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c .NET \u2014 \u043a\u043e\u043c\u0443 \u0437\u043d\u0430\u0442\u044c \u043a\u043e\u0434, \u043a\u0430\u043a \u043d\u0435 \u0438\u043c? \u041f\u043e\u0433\u043d\u0430\u043b\u0438! <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-342573","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/342573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=342573"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/342573\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=342573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=342573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=342573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}