MSBuild: Command Line Build error: Solution file error MSB5023: Error parsing the nested project section

后端 未结 5 1161
萌比男神i
萌比男神i 2021-01-07 16:55

I have a solution which uses Solution Folders to split out the projects. In the Visual Studio IDE, the solution builds fine.

However when running the build using MSB

相关标签:
5条回答
  • 2021-01-07 17:19

    Due to a merge conflict, my solution file was trying to stick two projects in a solution folder that didn't exist anymore. the NestedProjects section near the bottom mentioned a Guid that was removed from the Project enumeration at the top.

    0 讨论(0)
  • 2021-01-07 17:21

    It is possible you may also have an issue where the line could have gotten in here with a merge conflict where it wasn't deleted when a project was deleted. If you can't find any other references in your project with a global search of the GUID, try deleting the line in the .sln file and rebuilding.

    0 讨论(0)
  • 2021-01-07 17:25

    I faced the same issue and managed to sort out:

    1. Opened .sln in NotePad and found Guids
    2. One of my projects wasn't closed ("EndProject" was missed)

    Cheers, hope this can help anyone

    0 讨论(0)
  • 2021-01-07 17:41

    Or you can add a new file to the solution and save. This should rebuild the solution. After confirming the build is working fine, the file can be safely removed and saved.

    0 讨论(0)
  • 2021-01-07 17:44

    It's probably answered already but I'd mention in steps to make it even easier to do.

    Steps to fix:

    1. Add a new dummy project to the solution
    2. Use Save All button to update the solution
    3. Remove the dummy project added earlier & build. And it's fixed
    4. Additionally if you are using source control, compare the updated .sln file with old one to know the missing changes.
    0 讨论(0)
提交回复
热议问题