当我试图打开一个项目,本地或在团队基础服务器(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

从命令行运行eventvwr,查看它是否记录了任何应用程序错误。

这可能会给您一个更有用的实际错误消息。

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

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

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

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

我在打开Razor Views时也遇到了类似的问题

我登录了我的Azure帐户,它要求重新输入我的凭证。 重启VS 2015更新

解决方案: 当我试图构建/重建/清理我的.sln时,我得到了这个对话。为了解决这个问题,我需要停止绑定到应用程序的IIS站点并重新启动visual studio。(然后重新启动你的网站)。

我是如何发现原因的: 似乎这是一个相当普遍的消息,广泛的问题,我最终跟踪我的特定问题,由IIS锁定的几个文件与事件日志。

删除所有网站的解决方案是一种“从轨道上用核弹摧毁它”的方法,这应该被用作最后的手段。