.net “错误:解决方案中的一个或多个项目未正确加载”,尤其适用于 Windows7
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12821682/
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
"Error: One or more projects in the solution were not loaded correctly" particularly for Windows7
提问by sandy
I am trying to open a Project/Solution in VS 2010. I was able to open the same code successfully in Windows XP, where it gave a dialogue "Temporarily Work Uncontrolled", and on clicking Yes the code loaded and worked fine. But in Windows 7 when I try to open same code it gives me the error:
我正在尝试在 VS 2010 中打开一个项目/解决方案。我能够在 Windows XP 中成功打开相同的代码,在那里它给出了一个对话框“临时工作不受控制”,点击是,代码加载并运行良好。但是在 Windows 7 中,当我尝试打开相同的代码时,它给了我错误:
"One or more projects in the solution were not loaded correctly"
“解决方案中的一个或多个项目未正确加载”
and no project files are loaded in solution explorer.
并且解决方案资源管理器中没有加载任何项目文件。
回答by user2114670
I also faced the same problem. Here is what I did to resolve it:
我也面临同样的问题。这是我为解决它所做的:
Solution:
解决方案:
Run the solution file with administrator account. ex: Visual studio 2010 in your windows start menu, and right-click, run as administrator. Then, go to the file and open the solution file.
使用管理员帐户运行解决方案文件。例如:Windows 开始菜单中的 Visual Studio 2010,然后右键单击,以管理员身份运行。然后,转到该文件并打开解决方案文件。
Reason for Problem
问题原因
This occurred because we were creating the virtual directory for the project after copying that project to another location on the same machine. Thus, a virtual conflict occurred. Avoid this situation.
发生这种情况是因为我们在将该项目复制到同一台机器上的另一个位置后为该项目创建了虚拟目录。因此,发生了虚拟冲突。避免这种情况。
回答by Nasir Raza
Copy that project into Visual Studio's project folder , then open it from Visual Studio , now it will be open
将该项目复制到 Visual Studio 的项目文件夹中,然后从 Visual Studio 打开它,现在它将被打开
I found this technique by myself in Visual Studio 2013
我自己在 Visual Studio 2013 中发现了这种技术
回答by Paul Slechta
I had this same problem. The problem for me was in the .sln file. At the end of the file there were multiple of the following:
我有同样的问题。我的问题出在 .sln 文件中。在文件的末尾有多个以下内容:
GlobalSection(TeamFoundationVersionControl) = preSolution
GlobalSection(TeamFoundationVersionControl) = preSolution
EndGlobalSection
结束全局部分
I deleted the extra ones and the message went away.
我删除了多余的,消息就消失了。
I believe the cause of this is when TFS merges different check-ins of the solution or someone does it manually and does it wrong.
我相信造成这种情况的原因是 TFS 合并了解决方案的不同签入,或者有人手动执行并且做错了。
Paul
保罗
回答by Reid Evans
Just resolved this issue on an open source project. Issue was due to spaces rather than tabs for a line in the .sln file.
刚刚在一个开源项目上解决了这个问题。问题是由于 .sln 文件中一行的空格而不是制表符造成的。
https://github.com/fsprojects/Fix/commit/7f613791ed1b35714543eac163d6d9f78605cea8
https://github.com/fsprojects/Fix/commit/7f613791ed1b35714543eac163d6d9f78605cea8
回答by Pranay Aryal
This is in VS2017. One of the .csproj files had a merge conflict from git and I had not resolved it. Resolving that fixed the issue.
这是在 VS2017 中。其中一个 .csproj 文件与 git 存在合并冲突,我尚未解决。解决了这个问题。
回答by Michael Potter
I got this on windows 10.
我在 Windows 10 上得到了这个。
I figured out that the file paths were too long.
我发现文件路径太长了。
My solution was to move the repository to a shorter path.
我的解决方案是将存储库移动到更短的路径。
回答by Joel Wiklund
I was cloning a project (CleanArchitecture) and wanted to rename the namespace.
我正在克隆一个项目(CleanArchitecture)并想重命名命名空间。
- I cloned the project to
C:\Users\MyUser\source\repos\MyProject - Then I opened
Notepad++, pressedCtrl+F, went toFind in Filesand searched forCleanArchitectureand replaced withMyProject. This changed all occurrences of the project's namespace toMyProject, accept the name of the.csprojfiles inFile Explorer! - I had to manually go to
C:\Users\MyUser\source\repos\MyProjectand then change the name of the.csprojfiles. - Then in Visual Studio reload the projects.
- 我将项目克隆到
C:\Users\MyUser\source\repos\MyProject - 然后我打开
Notepad++,按下Ctrl+F,去Find in Files搜索CleanArchitecture并替换为MyProject。这改变了项目的命名空间中所有出现的MyProject,接受的名称.csproj中的文件File Explorer! - 我不得不手动转到
C:\Users\MyUser\source\repos\MyProject然后更改.csproj文件的名称。 - 然后在 Visual Studio 中重新加载项目。
回答by zelalem
Go to the Properties Window of the unavailable project showing the project's path. File Dialog box will open. Locate project file (.csproj) and click Open. Finally Reload the Project
转到显示项目路径的不可用项目的属性窗口。文件对话框将打开。找到项目文件 (.csproj) 并单击打开。最后重新加载项目
回答by bendecko
I am using Skydrive to share project files between Visual Studio copies on my laptop and PC.
我正在使用 Skydrive 在我的笔记本电脑和 PC 上的 Visual Studio 副本之间共享项目文件。
I looked in File Explorer and could see "online-only" against many of the files in my project. Turns out those files are not actually on the computer yet.
我查看了文件资源管理器,可以看到我的项目中的许多文件“仅在线”。原来这些文件实际上还没有在计算机上。
There is a setting in the metro skydrive app to force these to be copied over.
Metro skydrive 应用程序中有一个设置可以强制复制这些内容。
I got this info from https://johnfail.wordpress.com/2013/12/10/windows-8-1-making-all-skydrive-files-available-offline/
我从https://johnfail.wordpress.com/2013/12/10/windows-8-1-making-all-skydrive-files-available-offline/获得此信息
回答by Jakub Konecki
It looks like you don't have the same version of Visual Studio installed as the one in which those projects were created. For example, if the project you're opening is a C++ project, if will fail if you don;t have VS C++ installed. Or you cannot load a project for ASP.NET MVC if you don't have MVC installed.
看起来您安装的 Visual Studio 版本与创建这些项目的版本不同。例如,如果您打开的项目是一个 C++ 项目,如果您没有安装 VS C++ 将失败。或者,如果您没有安装 MVC,则无法为 ASP.NET MVC 加载项目。
Open project files in Notepad and look for a Project guid. Then google it and you will find out what project type is not supported by your current installation of VS.
在记事本中打开项目文件并查找项目 guid。然后谷歌它,你会发现你当前安装的VS不支持什么项目类型。
<ProjectGuid>{67122503-1A75-40CA-B37E-C0C4C9D6D38B}</ProjectGuid>

