C++ Visual Studio 2012 项目文件“”已重命名或不再在解决方案中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14573411/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio 2012 The project file "" has been renamed or is no longer in the solution
提问by nastassiar
I recently upgraded my IDE, but not my compiler from VS2010 to VS2012 and now I'm having issues with one of my solutions. When I try to build it I get below message.
我最近升级了我的 IDE,但没有将我的编译器从 VS2010 升级到 VS2012,现在我的解决方案之一出现问题。当我尝试构建它时,我收到以下消息。
The project file has been renamed or is no longer in the solution
项目文件已重命名或不再在解决方案中
And when I try to build the individual projects I get below message
当我尝试构建单个项目时,我收到以下消息
A build is already in progress
构建已经在进行中
I've tried removing and re-adding all the projects, but that doesn't help. I even created a brand new solution with all the same projects, but when I tried to build I got the same errors as with the original solution.
我已经尝试删除并重新添加所有项目,但这无济于事。我什至用所有相同的项目创建了一个全新的解决方案,但是当我尝试构建时,我遇到了与原始解决方案相同的错误。
I've read that lot of people have similar problems to this, but none of their solutions have helped me so far.
我读过很多人有类似的问题,但到目前为止他们的解决方案都没有帮助我。
One suggestion was to see if any projects had any missing reference but I'm not entirely sure how to go about doing that.
一个建议是查看是否有任何项目缺少任何参考,但我不完全确定如何去做。
I tried removing the references and re-adding them but every time I tried to re-add them I got the same error "The project file '' has been renamed or is no longer in the solution"
我尝试删除引用并重新添加它们,但每次尝试重新添加它们时,我都会遇到相同的错误“项目文件''已重命名或不再在解决方案中”
Any help or suggestions would be awesome!
任何帮助或建议都会很棒!
回答by Arve Hansen
I had the same problem, and solved it by making sure that every project referenced by other projects were included in the solution.
我遇到了同样的问题,并通过确保其他项目引用的每个项目都包含在解决方案中来解决它。
Right-click on the first project, choose References... and make sure every project listed under References are included. Go to the next and do the same.
右键单击第一个项目,选择 References... 并确保包含 References 下列出的每个项目。转到下一个并执行相同的操作。
That solved my problem with "The Project file '' has been renamed or is no longer in the solution". Not sure about the problem with "A build is already in progress".
这解决了我的“项目文件''已重命名或不再在解决方案中”的问题。不确定“构建已经在进行中”的问题。
回答by Dan K
I can confirm the_mantrill's scenario. (Posting as an answer, because this wouldn't fit in a comment.)
我可以确认 the_mantrill 的场景。(作为答案发布,因为这不适合评论。)
In my solution, Project A references Project B. For some reason, Project B's Project GUID changed. (I know this can happen, I didn't investigate what caused it in our case.) The solution file had the correct new GUID for Project B, but in Project A's project file, the reference to Project B still had the old GUID.
在我的解决方案中,项目 A 引用了项目 B。出于某种原因,项目 B 的项目 GUID 发生了变化。(我知道这可能发生,在我们的案例中我没有调查是什么原因造成的。)解决方案文件具有项目 B 的正确新 GUID,但在项目 A 的项目文件中,对项目 B 的引用仍然具有旧的 GUID。
By unloading and reloading projects in the Solution Explorer, I found that Project A caused "The project file '' has been renamed or is no longer in the solution." Once found, manually updating the Project B's GUID in Project A's project file fixed the problem.
通过在解决方案资源管理器中卸载和重新加载项目,我发现项目 A 导致“项目文件''已被重命名或不再在解决方案中。”一旦找到,在项目 A 的项目文件中手动更新项目 B 的 GUID 修复了问题。
Details:
细节:
ProjectB.vcxproj
项目B.vcxproj
<PropertyGroup Label="Globals">
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{9CF2493A-0C79-88E7-12ED-7DFAEBA8535B}</ProjectGuid>
</PropertyGroup>
At some point in the past, ProjectB's ProjectGuid used to be {d6f1934a-905f-77ca-49c0-164b2171a0f6}
. It's now {9CF2493A-0C79-88E7-12ED-7DFAEBA8535B}
.
在过去的某个时候,ProjectB 的 ProjectGuid 曾经是{d6f1934a-905f-77ca-49c0-164b2171a0f6}
. 现在是{9CF2493A-0C79-88E7-12ED-7DFAEBA8535B}
。
ProjectA.vcxproj– before, causes "The project file '' has been renamed or is no longer in the solution."
ProjectA.vcxproj– 之前,导致“项目文件''已重命名或不再在解决方案中。”
<ItemGroup>
<ProjectReference Include="..\ProjectB\ProjectB.vcxproj">
<Project>{d6f1934a-905f-77ca-49c0-164b2171a0f6}</Project>
</ProjectReference>
:
</ItemGroup>
ProjectA.vcxproj– after manual editing, now works:
ProjectA.vcxproj- 手动编辑后,现在可以工作:
<ItemGroup>
<ProjectReference Include="..\ProjectB\ProjectB.vcxproj">
<Project>{9CF2493A-0C79-88E7-12ED-7DFAEBA8535B}</Project>
</ProjectReference>
:
</ItemGroup>
回答by Marcos Eusebi
This problem is normally caused by the project version converter.
此问题通常是由项目版本转换器引起的。
The deal is that a Referenced project into a project in the solution isn't any longer in the solution(As I said, the cause is a problem in the conversion or manual delete).
交易是解决方案中的项目中的引用项目不再存在于解决方案中(正如我所说,原因是转换或手动删除中的问题)。
So you had to see all projects references(Right click on the project -> "References..."
) and check that every referenced project exist in the solution - otherwise add the missing project to the solution or remove the invalid modifier.
因此,您必须查看所有项目引用( Right click on the project -> "References..."
) 并检查解决方案中是否存在每个引用的项目 - 否则将缺少的项目添加到解决方案或删除无效修饰符。
This awnser is based over an existing awnser: https://stackoverflow.com/a/14722733/1107020
此 awnser 基于现有的 awnser:https://stackoverflow.com/a/14722733/1107020
回答by the_mandrill
The problem seemed to occur for me when I had two solution files for different products, but which had several projects in common. These were VS2010 projects that I was opening for the first time in VS2012. When opening the first one all the projects were converted. The problem then arose when loading the second one as some of the projects had already been converted. It seemed to be the project references had been updated in the first solution, but then for the second solution it had to deal with updating some projects but using the already-updated versions of the common projects.
当我有两个不同产品的解决方案文件,但有几个共同的项目时,这个问题似乎发生在我身上。这些是我在 VS2012 中第一次打开的 VS2010 项目。打开第一个时,所有项目都已转换。然后在加载第二个时出现问题,因为一些项目已经转换。似乎第一个解决方案中的项目引用已更新,但是对于第二个解决方案,它必须处理更新某些项目但使用公共项目的已更新版本。
In the end, to solve it I had to remove and then re-add a couple of projects (and the project references) and that seemed to sort it out. It's also worth removing the build folders and the other temporary files (such as .suo) as the state of some of those files affected the project references problem (which I really didn't expect).
最后,为了解决它,我不得不删除然后重新添加几个项目(和项目引用),这似乎解决了它。删除构建文件夹和其他临时文件(例如 .suo)也是值得的,因为其中一些文件的状态影响了项目引用问题(我真的没想到)。
回答by WeisserHund
delete the .suo and reload worked for me after moving from VSO to onsite TFS had some issues
从 VSO 移动到现场 TFS 后,删除 .suo 并重新加载对我有用
The project file has been moved renamed or not on your computer
回答by livan afryanto
Exactly once, at first I did not believe the measures "make sure all the references there" was successful.
刚好有一次,起初我不相信“确保所有参考文献”的措施是成功的。
Finally I try to check all projects, especially web project in solution I, Seriously there are unavailable. I delete the reference and voila, it works!
最后我尝试检查所有项目,尤其是解决方案 I 中的 web 项目,严重不可用。我删除了参考,瞧,它有效!
回答by Jesse Chisholm
I had the same symptoms, but a very different cause, and therefore, resolution.
我有同样的症状,但一个非常不同的原因,因此,解决方案。
In migrating from VS 2003 => 2005> => 2008 => 2010 => 2012 somehow in that last step a Resources.resxfile disappeared. Thus the message
在从 VS 2003 => 2005> => 2008 => 2010 => 2012 迁移时,在最后一步中,Resources.resx文件以某种方式消失了。因此消息
"The project file '' has been renamed or is no longer in the solution."
“项目文件 '' 已重命名或不再在解决方案中。”
For me, it wasn't a "Projectfile", but a" Project'sFile". (and some people say grammar isn't important.)
对我来说,它不是“项目文件”,而是“项目文件”。(有些人说语法不重要。)
I tracked down the missing Resources.resxfile and all is well for me.
我找到了丢失的Resources.resx文件,一切顺利。
回答by octave
I meet the issue when copy a project to another folder and reopen it Finally I solved the problem by the below ways: 1. right-click on the project 2. open the reference option 3. delete the reference project in the pages
将项目复制到另一个文件夹并重新打开时遇到问题最后我通过以下方式解决了问题:1.右键单击项目2.打开引用选项3.删除页面中的引用项目
回答by liorda
Make sure all project files (*.vcxproj) in the solution have the matching GUID in defined in them, something like that:
确保解决方案中的所有项目文件 (*.vcxproj) 都定义了匹配的 GUID,如下所示:
<PropertyGroup Label="Globals">
<ProjectGuid>{B4D8DE30-8DCC-85FC-ABFE-3ED6S9F873C0}</ProjectGuid>
</PropertyGroup>
For some weird reason projects converted from VS2008 didn't have that, and VS2010 insisted to replace all projects' GUID in the solution fileevery time it loaded the solution, but never actually added them the the project files.
由于一些奇怪的原因,从 VS2008 转换的项目没有那个,VS2010每次加载解决方案时都坚持替换解决方案文件中所有项目的 GUID ,但实际上从未将它们添加到项目文件中。