Search code examples
gitvisual-studio-2017team-explorer

TeamExplorer with git in VisualStudio 2017 claims solution file has changed, while showing no change


At some point in the project, TeamExplorer began to constantly indicate changes on the solution file, but the comparison with the unmodified version in VS does not show any change.

Screenshot: Team Explorer claiming solution file has been changed

What I tried so far:

  1. To exclude a git issue, I opened git bash and ran git status, but no changes show up either.
  2. The Team Explorer's git console shows this, when I try to stage the ghost update:

    File not staged because it is modified in memory but not saved to disk: C:\Develop\playground\ClassLibrary1\ClassLibrary1.sln

  3. Clicking any save buttons or menu function in VS won't help.

  4. Trying to commit this ghost change by the Commit All action button, VS displays a general error "fatal: unexpected sequence in commit output.".

  5. Re-cloning the entire repo doesn't help.

  6. Committing other changes onto the solution file won't help.

  7. Line endings checkout fine (CR/LF).

Visual Studio Version is 15.5.5.

Any idea whats causing this or how to get rid of it?


This is my solution file:

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2026
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassLibrary1", "ClassLibrary1\ClassLibrary1.csproj", "{3E6F764F-D995-4551-921E-43D70B3129B8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9781EEA-6178-46BD-82B9-AED6B76C8D14}"
    ProjectSection(SolutionItems) = preProject
        version.json = version.json
    EndProjectSection
    ProjectSection(FolderGlobals) = preProject
         __JSONSchema = 
    EndProjectSection
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
        Release|Any CPU = Release|Any CPU
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {3E6F764F-D995-4551-921E-43D70B3129B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {3E6F764F-D995-4551-921E-43D70B3129B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {3E6F764F-D995-4551-921E-43D70B3129B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {3E6F764F-D995-4551-921E-43D70B3129B8}.Release|Any CPU.Build.0 = Release|Any CPU
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
    GlobalSection(ExtensibilityGlobals) = postSolution
        SolutionGuid = {7EDCF511-FC54-4E98-9064-11E9A1B43DD1}
    EndGlobalSection
EndGlobal

Solution

  • I could solve the issue by removing the line

    __JSONSchema = 
    

    This line has been introduced while the JSON file version.json was added to the solution. The schema drop down box in the JSON file editor was set to an arbitrary entry by VisualStudio. Then I chose <No schema selected> and saved the solution. That's how the broken line was created.