Excel 文件保存后从解决方案资源管理器中消失

发布于 2025-01-07 23:19:20 字数 530 浏览 0 评论 0原文

设置:Windows 7、Visual Studio 2010(带有 TFS2010*)、Excel 2007 Full/2010 Starter

重现步骤:

  1. 在空的 Visual Studio 中,单击“文件”->“Excel 2007 Full/2010 Starter”。新项目->空白解决方案,记下解决方案目录,然后单击“确定”
  2. 打开 Excel 并创建一个新的 Excel 文件,将其保存在新的解决方案目录中,然后关闭 Excel
  3. 在解决方案资源管理器中右键单击新的解决方案 ->添加->现有项目
  4. 选择 Excel 文件,一旦添加到解决方案,它应该自动在 Excel 中打开(如果没有,则手动打开)
  5. 保存 Excel 文件 文件
  6. 从解决方案资源管理器中消失

有谁知道如何阻止此情况发生?

** 我不认为 TFS 与这种情况有任何关系,但为了完整性我添加了它

Set-up: Windows 7, Visual Studio 2010 (with TFS2010*), Excel 2007 Full/2010 Starter

Reproduction steps:

  1. In an empty Visual Studio, click on File -> New Project -> Blank Solution, note the solution directory and click on OK
  2. Open Excel and create a new Excel file, save it in the new Solution directory, then close Excel
  3. Right-click on the new Solution in Solution Explorer -> Add -> Existing Item
  4. Select the Excel file, and once added to the solution, it should automatically open in Excel (if it doesn't, then open it manually)
  5. Save the Excel file
  6. The file disappears from Solution Explorer

Does anyone know how to stop this from happening?

** I don't think TFS has anything to do with the situation, but I've added it for completeness

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

过度放纵 2025-01-14 23:19:20

IMO 这是 Visual Studio 中的一个错误。我已经多次见证过这一点。解决方案项目似乎会定期消失,并且似乎是通过修改 VS 外部的解决方案文件来触发的。很多时候,我用较新的版本复制了一个文件,也许是因为该文件被暂时删除,然后由副本重新创建,VS 检测到短暂的删除并认为应该将其从解决方案中删除。 (我所说的瞬间可能是毫秒。)

使用 TFS 时,通常当我去签入某些内容时,我会注意到解决方案文件已签出,即使我没有编辑它,并且当我比较 sln 文件时我意识到 VS 认为解决方案文件已被删除,所以我必须撤消 sln 文件的签出。事实上,这已经多次困扰着我,以至于现在每当我检查 sln 文件时,我都会对其进行比较,以确保 VS 不会试图从我身边溜走。
(由于这个问题,我还花了相当多的时间来修复其他团队成员意外签入 sln 文件的问题。)

IMO this is a bug in Visual Studio. I have witnessed this many times. Solutions items seem to vanish periodically, and it seems to be triggered by modifying a Solution file outside of VS. Many times I have copied over a file with a newer version, and perhaps because the file is momentarily deleted and then recreated by the copy, VS detects the short-lived deletion and thinks it should be removed from the solution. (By momentarialy I mean perhaps a ms.)

When using TFS, oftentimes when I go to check in something, I'll notice the solution file is checked out, even if I didn't edit it, and when I compare the sln file I realize VS thought a solution file was deleted, so I have to undo the checkout of the sln file. In fact, this has bit me in the butt so many times that now anytime I am checking in the sln file I compare it just to make sure VS didn't try to slip one past me.
(And I've also spent quite a few hours of my life fixing accidental checkins of the sln file by other team members due to this issue.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文