Why does it say “Project with that name already op

2019-03-14 10:59发布

问题:

I recently migrated a VSS database to TFS 2008. Using Source Control Explorer, I got the latest version of a solution with 12 projects.

When I opened the solution in VS 2005, two of the projects were not found. I am not sure why these two projects were not found, but thought it easiest to just delete and re-add them to the solution.

When I do this, VS gives me a "A project with that name is already open in the solution." The project doesn't appear in solution explorer, and is not listed in the .sln file.

Any ideas?

回答1:

I had the same message... Seems like it comes from (.csproj) project file. Under first propertygroup there is a section named

<ProjectTypeGuids>...</ProjectTypeGuids> 

which generally tells Visual Studio to handle that project in some specific way. Some Guids can be found here.

First make a backup copy of that file. Then removing that section can help you open the project as usual project. As it seems that the Visual Studio thinks that the project is not the type that is specified in the ProjectTypeGuids.



回答2:

I had this problem and I was able to solve it using the following steps:

  1. Remove the project from the solution.
  2. restart visual studio.
  3. add the project to the solution as an existing project.


回答3:

If anyone uses AnkhSVN instead of TFS, it's also possible, that the .sln-file need the following lines:

GlobalSection(SubversionScc) = preSolution
    Svn-Managed = True
    Manager = AnkhSVN - Subversion Support for Visual Studio
EndGlobalSection

in the "Global" section.



回答4:

This did it for me:

  1. remove the section <ProjectTypeGuids>...</ProjectTypeGuids> in each project
  2. reopen each project, then save to overwrite the existing project file, finally exit
  3. reopen the solution file
  4. pray (optional)


回答5:

I have to say that removing the section <ProjectTypeGuids>...</ProjectTypeGuids> could create some problems. In fact, such a section defines the type of the project and, if removed, could disable some features. For example, if your project was originally defined as Smart Device (C#), after removing the aforementioned section the on-device debug may not working properly.



回答6:

Delete .suo file. Build solution. Add Projects.



回答7:

I would try hand editing the project/solution files, they are text and pretty easy to read. You can edit the file in notepad. To open up the file as text in visual studio you need to first close the solution. Then do file->open and select the sln file, but instead of hitting the open button, press on the right side where there is an arrow and select open with.. from there you can select source code editor (text).



回答8:

I had the same problem when i migrated a website to a web app project.

  1. Unload the web app.
  2. Add the existing website.
  3. Reload the web app.


回答9:

The following worked for me when I moved a project running vs2010 to another laptop.

I removed exactly the following and it worked:

<ProjecctType>Guid of sorts</ProjectType>
<SccProjectName>Svn</SccProjectName>
<SccLocalPath>Svn</SccLocalPath>
<SccAuxPath>Svn</SccAuxPath>
<SccProvider>SubversionScc</SccProvider>


回答10:

For those looking for this while dealing with VSTO projects...

Be sure to have the Office Tools for Visual Studio installed in your machine before opening the project.



回答11:

I solved it by changing Windows' regional settings. Instead of "English (Europe)", I used "English (United States)". Others have reported similar behaviors with changing for example from "Russian (Ukraine)" to "Russian (Russia)", etc. -AlessandroSegala

Work For me.

Ref: http://answers.microsoft.com/en-us/windows/forum/windows_10-windows_install/customized-cultures-cannot-be-passed-by-lcid-only/26eb9d4b-7ddb-4774-8a40-7a7d84ba9277?auth=1&rtAction=1455534187354



回答12:

In my case it was corrupted vbproj file. First line was missing:

<?xml version="1.0" encoding="utf-8"?>

After adding this line I had to close the solution, delete .vs folder and open again.