Visual Studio 弹出窗口:“无法完成操作" [英] Visual Studio popup: "the operation could not be completed"

查看:41
本文介绍了Visual Studio 弹出窗口:“无法完成操作"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在本地或在 Team Foundation Server (TFS) 上打开项目时, 我得到一个模态窗口告诉我:

When I try to open a project, local or on a Team Foundation Server (TFS), I get a modal window telling me that:

无法完成操作:未指定错误

The operation could not be completed: Unspecified error

或者同样的消​​息,但是用Class not defined.."而不是Unspecified error".

Or the same message, but with "Class not defined.." instead of "Unspecified error".

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

These errors started happening earlier today when I tried to check in some of my work to the team foundation server. I have tried using Visual Studio 2008 on the same computer, but I still get the same error. I've also googled for it but none of the solutions seems to help me.

我也安装了来自 Windows Update 的最新更新.

I have installed the latest updates from Windows Update as well.

有什么想法吗?

推荐答案

您是否尝试过删除 Your_Solution_FileName.suo 文件?

Have you tried to delete the Your_Solution_FileName.suo file?

.suo 文件应该与您的 .sln 文件在同一个文件夹中,或者在 .vs 文件夹中以获得较新版本的视觉工作室..vs 文件夹可能已隐藏.

The .suo file should be in the same folder as your .sln file, or in the .vs folder for newer versions of Visual Studio. The .vs folder might be hidden.

Visual Studio 2017 更新
在 VS 2017 中,.suo 文件位于不同的文件夹中:您可以在 YourSolutionFolder.vsYourSolutionNamev15 中找到 .suo 文件.suo

Update for Visual Studio 2017
In VS 2017 the .suo files are located in a different folder: you can find the .suo file in YourSolutionFolder.vsYourSolutionNamev15.suo

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

The .vs folder is hidden, and the .suo files is a file without name, with just the .suo extension.


说明

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

The .suo file contain various information like the opened files list, and some preferences that are not saved in the solution file (like the starting project) and other things.

通常您可以毫无问题地删除.suo 文件.之后您可能需要为您的解决方案设置 StartUp Project.

Normally you can delete the .suo file without problems. You might have to set the StartUp Project for your solution afterwards.

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

Just to stay on the safe way, you can rename the .suo file, and then retry to start the solution, to see if this help.

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

In my experience sometime VS crash on start because there is an error in some source code, and due to that error VS can't compile the code, and then crash because without compiled code it's unable to show form in design mode. In this case, deleting the .suo file will solve the situation because it reset the open files list, so the solution can start up without opening/showing any files.

删除 .suo 文件时不起作用
以下是在删除 .suo 文件无法解决问题时您可以尝试的其他操作列表:

When deleting the .suo file doesn't works
Here's a list of other things you can try when deleting the .suo file doesn't resolve the issue:

  • 重启电脑
  • 清理 Windows 临时文件夹
  • 从 IDE 中清除解决方案 (MenuBuildClean Solution)
  • 手动清理解决方案(删除/bin/文件夹中已编译的DLL/EXE并清空/obj/文件夹中VS在构建过程中创建的临时文件> 文件夹(组成解决方案的每个项目都有这些文件夹,所以把它们都清理干净))
  • 尝试逐一打开组成解决方案的每个项目并构建它,以了解哪个是产生问题的特定项目
  • 了解触发错误的更改/编辑/修改是什么,然后将其撤消(源代码控制工具可以提供帮助...)
  • 如果您有自定义控件:检查构造函数中的代码.即使在设计时,VS IDE 也会调用自定义控件的构造函数,并且可能会发生奇怪的事情(在设计时某些属性不起作用,您的连接字符串可能未填充...)
  • Restart the computer
  • Clean Windows temp folder
  • Clean the solution from the IDE (MenuBuildClean 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...)

作为最后的手段...

As a last resort...

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

这篇关于Visual Studio 弹出窗口:“无法完成操作"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆