Why does it say “Project with that name already op

2019-03-14 10:54发布

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?

12条回答
够拽才男人
2楼-- · 2019-03-14 11:26

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.

查看更多
家丑人穷心不美
3楼-- · 2019-03-14 11:28

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.
查看更多
不美不萌又怎样
4楼-- · 2019-03-14 11:28

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.

查看更多
闹够了就滚
5楼-- · 2019-03-14 11:31

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.

查看更多
做自己的国王
6楼-- · 2019-03-14 11:34

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.

查看更多
我欲成王,谁敢阻挡
7楼-- · 2019-03-14 11:35

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.
查看更多
登录 后发表回答