title: Build fails because of System.Text.Json generated code
body: <p>I'm using the source generation from System.Text.Json (version 6.0.5).</p>
  <p>My code looks like this.</p>
  <pre class="lang-cs prettyprint-override"><code>[JsonSerializable(typeof(AuthenticationToken))]
  [JsonSerializable(typeof(AuthenticationData))]
  [JsonSerializable(typeof(ApplicationSettings))]
  [JsonSerializable(typeof(Refit.ProblemDetails))]
  // (...)
  public partial class JsonContext : JsonSerializerContext
  {
  }
  
  // (...)
  private static JsonSerializerOptions GetDefaultOptions()
  {
      var options = new JsonSerializerOptions();
      options.AddContext&lt;JsonContext&gt;();
  
      return options;
  }
  </code></pre>
  <p>This code is in a NetStandard2.0 library. Apart from the project and package references, the csproj only contains the following properties.</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;PropertyGroup&gt;
      &lt;TargetFramework&gt;netstandard2.0&lt;/TargetFramework&gt;
      &lt;LangVersion&gt;9.0&lt;/LangVersion&gt;
  &lt;/PropertyGroup&gt;
  </code></pre>
  <p>This code works locally in both Release and Debug configuration and with both Visual Studio 2022 and 2019.</p>
  <h2>Problem</h2>
  <p>When I build the same code in my CI pipeline, it yields the following errors.</p>
  <pre><code>##[error]C:\WIN1809-01\_work\11\s\src\app\ApplicationTemplate.Presentation\System.Text.Json.SourceGeneration\System.Text.Json.SourceGeneration.JsonSourceGenerator\JsonContext.g.cs(10,6): Error CS0579: Duplicate 'global::System.CodeDom.Compiler.GeneratedCodeAttribute' attribute
  ##[error]C:\WIN1809-01\_work\11\s\src\app\ApplicationTemplate.Presentation\System.Text.Json.SourceGeneration\System.Text.Json.SourceGeneration.JsonSourceGenerator\JsonContext.Type.g.cs(11,100): Error CS0102: The type 'JsonContext' already contains a definition for '_Type'
  ##[error]C:\WIN1809-01\_work\11\s\src\app\ApplicationTemplate.Presentation\System.Text.Json.SourceGeneration\System.Text.Json.SourceGeneration.JsonSourceGenerator\JsonContext.Type.g.cs(12,98): Error CS0102: The type 'JsonContext' already contains a definition for 'Type'
  ##[error]C:\WIN1809-01\_work\11\s\src\app\ApplicationTemplate.Presentation\System.Text.Json.SourceGeneration\System.Text.Json.SourceGeneration.JsonSourceGenerator\JsonContext.String.g.cs(11,102): Error CS0102: The type 'JsonContext' already contains a definition for '_String'
  ##[error]C:\WIN1809-01\_work\11\s\src\app\ApplicationTemplate.Presentation\System.Text.Json.SourceGeneration\System.Text.Json.SourceGeneration.JsonSourceGenerator\JsonContext.String.g.cs(12,100): Error CS0102: The type 'JsonContext' already contains a definition for 'String'
  </code></pre>
  <p>These are just the first few lines. There are actually ~200 lines of similar errors, all originating from <code>JsonContext.xxx.g.cs</code> generated files.</p>
  <p><strong>Is this a known problem? Am I just missing some config?</strong></p>