Why is there duplicate schema text in the appsettingsschema.json?

Falanga, Rod, DOH 1,250 Reputation points
2026-09-09T17:17:22.54+00:00

An application that I've help write and now maintain, is putting this text into Visual Studio 2026's Output window:

There are problems with this document's schema impacting one or more items in the document. Please report this issue to schema owner.

    Items must be unique
    at (line 1094, column 9) in document C:\GitHub\Prod\FPTimetrackCore\FPTimetrackCore\FPTimetrackCore\FPTimetrackCore\obj\Debug\net9.0\appsettingsschema.json
    at schema text "CredentialSource"

It is in that window twice.

Why is it there? I've not created it. And as you can see it is in the obj folder, which is ignored in the Git repo. I've checked the appsettingsschema.json in the indicated folder, and it does have two instances of "CredentialSource" in it. I presume the appsettingsschema.json file is created by VS 2026 during a build.

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Bruno Caetano de Brito 245 Reputation points
    2026-10-09T12:03:00.27+00:00

    Hi Rod,

    You are correct: appsettingsschema.json is not a file you created manually. It is generated during the project’s design-time/build process and is used by Visual Studio to provide validation and IntelliSense for appsettings.json.

    Some NuGet packages provide JSON Schema fragments. These fragments are combined into a generated file under:

    obj\<Configuration>\<TargetFramework>\appsettingsschema.json
    

    That is why the file is under obj and should remain excluded from source control.

    In this case, the duplicate CredentialSource entry is caused by a known schema-combination issue involving Azure.Core and System.ClientModel. Both schema fragments declared CredentialSource as required, and the schema combiner concatenated the required arrays without removing duplicate values. This resulted in something similar to:

    "required": [
     "CredentialSource",
     "CredentialSource"
    ]
    

    Because that array requires unique values, Visual Studio reports:

    Items must be unique
    

    The issue was corrected in Azure.Core by removing the duplicate declaration from its schema fragment. [github.com], [github.com]

    How to resolve it

    First, check which version of Azure.Core is being resolved by the project, including transitive dependencies:

    dotnet list package --include-transitive
    

     

    Look for Azure.Core in the output and identify which top-level Azure SDK package is bringing it into the project.

    If possible, update that top-level Azure package. Alternatively, add or update the direct Azure.Core reference to a fixed compatible version, such as 1.54.0 or a newer stable version:

    dotnet add package Azure.Core --version 1.54.0
    

    Azure.Core version 1.54.0 is available on NuGet, and the related schema correction was implemented for that release line. [github.com], [nuget.org]

    After updating the package:

    1. Close Visual Studio.
    2. Delete the project’s bin and obj folders.
    3. Restore the NuGet packages.
    4. Reopen Visual Studio and rebuild the project.

    You can also run:

    dotnet clean
    dotnet restore
    dotnet build
    

    Do not manually edit appsettingsschema.json, because it is generated and your changes will be overwritten.

    The warning concerns the schema used by the editor for validation and IntelliSense. It should not affect how the application reads its configuration at runtime.

    The message appearing twice may mean that Visual Studio is validating multiple appsettings*.json files, such as appsettings.json and appsettings.Development.json, or that the generated schema is being processed by more than one design-time validation pass.

    If updating the packages does not resolve it, please share the Azure.Core and System.ClientModel versions shown by:

    dotnet list package --include-transitive
    

    That will help identify which dependency is still contributing the affected schema.

    If this answer helped resolve the issue, please consider marking it as Accepted Answer. This helps other community members find the solution more easily.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.