Visual Studio: Cannot add project to source control; it overlaps a project that is already bound to source control at a lower root
I've been getting this error a bit lately as I trying to add new projects to the solution, and then add them to source control:
The project
<ProjectName>
cannot be added to source control. In folder<SolutionDir>
, it overlaps a project that is already bound to source control at a lower root. To avoid this problem, add the project from a location below the binding root of the other source controlled projects in the solution.
The cause of this was that I had linked files within the new project that were pointing to existing files higher up in the solution folder (in this instance, in the solution root).
In this case I was linking to the strong name key from the solution root:
Microsoft.Playwright.PlaywrightException: Error: The language "raw" has no grammar.
at Object.highlight (http://127.0.0.1:41899/main.js:3978:11)
at eval (eval at evaluate (:226:30), :2:18)
at UtilityScript.evaluate (:233:19)
at UtilityScript. (:1:44)
at Microsoft.Playwright.Transport.Connection.InnerSendMessageToServerAsync[T](ChannelOwnerBase object, String method, Dictionary`2 dictionary, Boolean keepNulls) in /_/src/Playwright/Transport/Connection.cs:line 209
at Microsoft.Playwright.Transport.Connection.WrapApiCallAsync[T](Func`1 action, Boolean isInternal) in /_/src/Playwright/Transport/Connection.cs:line 535
at Microsoft.Playwright.Core.Frame.EvaluateAsync[T](String script, Object arg) in /_/src/Playwright/Core/Frame.cs:line 548
at SiteGen.Extensions.Markdown.Prism.PrismHost.Highlight(String source, String language)
at SiteGen.Extensions.Markdown.Prism.PrismCodeBlockRenderer.Write(HtmlRenderer renderer, PrismCodeBlock obj)
To add the project to source control, you have to remove these links first, add the project to source control, then you can put your links back in.