When attempting to add back existing projects to a Visual Studio 2015 solution, VS gives the following error message. I have verified I have not already added a reference to the project I am trying to add. Is there a settings or cache file I need to delete or cleanup somewhere?
An equivalent project (a project with the same global properties and tools version) is already present in the project collection, with the path "D:\My\Path\MyProject.csproj". To load an equivalent into this project collection, unload this project first.
I invoked it through code.
This fixed it for me:
Microsoft.Build.Evaluation.ProjectCollection.GlobalProjectCollection.LoadedProjects.FirstOrDefault(d => d.FullPath == projectFilePath) ??
Microsoft.Build.Evaluation.Project.FromFile(projectFilePath, new ProjectOptions())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With