当我试图打开一个项目,本地或在团队基础服务器(TFS),我得到一个模态窗口告诉我:

操作无法完成:未指明的错误

或者是同样的消息,但是“类未定义..”而不是“未指定的错误”。

这些错误在今天早些时候开始发生,当时我试图将我的一些工作签入到团队基础服务器。我尝试在同一台计算机上使用Visual Studio 2008,但我仍然得到相同的错误。我也在谷歌上搜索过,但似乎没有一个解决方案能帮到我。

我也安装了Windows Update的最新更新。

什么好主意吗?


当前回答

您是否尝试删除Your_Solution_FileName. exe文件。缩文件?

.suo文件应该与你的.sln文件在同一个文件夹中,对于更新版本的Visual Studio,应该在.vs文件夹中。.vs文件夹可能被隐藏。


更新Visual Studio 2017 在VS 2017中。suo文件位于不同的文件夹中:您可以在YourSolutionFolder\.vs\YourSolutionName\v15\.suo中找到。suo文件

.vs文件夹是隐藏的,.suo文件是一个没有名称的文件,只有.suo扩展名。


  解释

.suo文件包含各种信息,如打开的文件列表,以及一些未保存在解决方案文件中的首选项(如启动项目)和其他内容。

通常情况下,删除.suo文件没有问题。之后,您可能必须为解决方案设置StartUp项目。

为了安全起见,您可以重命名.suo文件,然后重试启动解决方案,看看这是否有帮助。

根据我的经验,有时VS在启动时崩溃,因为一些源代码中有错误,由于这个错误,VS无法编译代码,然后崩溃,因为没有编译代码,它无法在设计模式中显示形式。 在这种情况下,删除.suo文件将解决这种情况,因为它重置了打开的文件列表,因此解决方案可以在不打开/显示任何文件的情况下启动。


当删除.suo文件无效时 当删除.suo文件不能解决问题时,您可以尝试以下其他方法:

Restart the computer Clean Windows temp folder Clean the solution from the IDE (Menu\Build\Clean Solution) Clean the solution manually (delete the compiled DLL/EXE in the /bin/ folder and empty the temporary files that VS create during the build process in the /obj/ folder (each project that compose the solution has these folders, so clean them all)) Try to open each single project that compose the solution 1-by-1 and build it, to understand which is the specific project that generate the issue Understand what is the change/edit/modification that triggered the error, and undo it (source control tool can help...) If you have custom controls: check the code in the constructor. The VS IDE will call the constructor of your custom controls even at design time, and weird things can happen (at design time some properties dont works, your connection string probably isn't populated...)

作为最后的手段……

尝试安装任何VS更新 尝试禁用VS扩展(如果你安装了任何…) 尝试更新解决方案中引用的任何外部DLL/控件 尝试更新Windows

其他回答

您是否尝试删除Your_Solution_FileName. exe文件。缩文件?

.suo文件应该与你的.sln文件在同一个文件夹中,对于更新版本的Visual Studio,应该在.vs文件夹中。.vs文件夹可能被隐藏。


更新Visual Studio 2017 在VS 2017中。suo文件位于不同的文件夹中:您可以在YourSolutionFolder\.vs\YourSolutionName\v15\.suo中找到。suo文件

.vs文件夹是隐藏的,.suo文件是一个没有名称的文件,只有.suo扩展名。


  解释

.suo文件包含各种信息,如打开的文件列表,以及一些未保存在解决方案文件中的首选项(如启动项目)和其他内容。

通常情况下,删除.suo文件没有问题。之后,您可能必须为解决方案设置StartUp项目。

为了安全起见,您可以重命名.suo文件,然后重试启动解决方案,看看这是否有帮助。

根据我的经验,有时VS在启动时崩溃,因为一些源代码中有错误,由于这个错误,VS无法编译代码,然后崩溃,因为没有编译代码,它无法在设计模式中显示形式。 在这种情况下,删除.suo文件将解决这种情况,因为它重置了打开的文件列表,因此解决方案可以在不打开/显示任何文件的情况下启动。


当删除.suo文件无效时 当删除.suo文件不能解决问题时,您可以尝试以下其他方法:

Restart the computer Clean Windows temp folder Clean the solution from the IDE (Menu\Build\Clean Solution) Clean the solution manually (delete the compiled DLL/EXE in the /bin/ folder and empty the temporary files that VS create during the build process in the /obj/ folder (each project that compose the solution has these folders, so clean them all)) Try to open each single project that compose the solution 1-by-1 and build it, to understand which is the specific project that generate the issue Understand what is the change/edit/modification that triggered the error, and undo it (source control tool can help...) If you have custom controls: check the code in the constructor. The VS IDE will call the constructor of your custom controls even at design time, and weird things can happen (at design time some properties dont works, your connection string probably isn't populated...)

作为最后的手段……

尝试安装任何VS更新 尝试禁用VS扩展(如果你安装了任何…) 尝试更新解决方案中引用的任何外部DLL/控件 尝试更新Windows

有时只是关闭Visual Studio 2015然后重新打开的问题。

更新:Visual Studio 2017显然也是如此。

我在一些机器上遇到过这种情况。

这种情况确实会发生。

您是否尝试删除“Your_Solution_FileName. exe”文件。缩文件?”

还有电脑崩溃,比如停电等…

适用于更新2和更新3,以及新鲜的基础没有任何更新…

确保你的输出窗口是可见的,然后按下F5按钮。如果你将输出窗口最大化,当你重新启动Visual Studio时,它偶尔不会重新打开输出窗口。

简单解决办法: 1. 重启Visual Studio 2. 在构建项目之前,使用视图->输出窗口

现在,当您构建时,它应该可以工作。

(我很确定删除.suo和.user文件只会起作用,因为它会将Visual Studio重置为默认布局,从而确保输出窗口可见。)

我刚刚在VS22中尝试运行时,我可以打开并构建良好,否则,从技术上讲,这是一个不同的问题,但由于这是谷歌中出现的第一件事,我想评论。

我的问题是,我的项目过滤器文件添加了一个无效的新条目。由于我使用的是一个虚幻项目,这是复杂的事实,项目和过滤器是生成的,而不是检入源代码控制。

如果遇到此问题,请查看.vcxproj中是否有任何奇怪的条目。过滤器文件。

对于虚幻项目,这将位于 \ \中级\ ProjectFiles \引擎

我重启了电脑,它不见了。