visual-studio VS 损坏的 .sln 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3299660/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 12:13:20  来源:igfitidea点击:

VS corrupted .sln file?

visual-studiotfssolutioncorruption

提问by Larry Watanabe

When I try to open my .sln file, Visual Studio quits on me. I can open it by opening up TFS, getting a specific version, choosing the latest version, forcing an overrwrite, opening up the .sln file, and then ignoring an 'incompatible doc message".

当我尝试打开 .sln 文件时,Visual Studio 退出。我可以通过打开 TFS,获取特定版本,选择最新版本,强制覆盖,打开 .sln 文件,然后忽略“不兼容的文档消息”来打开它。

However, I would like to know what's wrong and how it can be fixed, in case some day I can't do this.

但是,我想知道出了什么问题以及如何修复,以防有一天我无法做到这一点。

How can this be fixed?

如何解决这个问题?

回答by Richard

I would think this is more likely to be the .suo(which is a hidden file). These are know to corrupt (and this has been true since at least VC++ V6). Deleting it will clear all sorts of odd/erroneous behaviour in VS.

我认为这更有可能是.suo(这是一个隐藏文件)。众所周知,这些会损坏(至少从 VC++ V6 开始就是如此)。删除它会清除 VS 中的各种奇怪/错误行为。

(The .suoholds local settings: which files are open and layout, breakpoints, bookmarks, ... only: nothing that really matters to the solution or projects.)

.suo保存本地设置:哪些文件是打开的和布局、断点、书签,...仅:对于解决方案或项目没有什么真正重要的。)

For Visual Studio 2015 and 2017: rather than being in the same location as the solution (.sln) file, it is now held in a, hidden, folder called .vsin the folder containing the solution file.

对于 Visual Studio 2015 和 2017:而不是与解决方案 ( .sln) 文件位于同一位置,它现在保存在.vs包含解决方案文件的文件夹中调用的隐藏文件夹中。

回答by SteveCav

Have you tried creating a new sln and importing all the projs? if it doesn't solve the corruption, it may point to a project with a problem.

您是否尝试过创建一个新的 sln 并导入所有 projs?如果它不能解决损坏,它可能指向一个有问题的项目。

回答by Joel Rondeau

Get copies of both versions of the file and use your favorite dif tool to see what's changed. sln files are xml (i.e. human readable), so it isn't too hard to figure out what happened.

获取文件的两个版本的副本并使用您最喜欢的 diff 工具查看更改的内容。sln 文件是 xml(即人类可读的),所以不难弄清楚发生了什么。

回答by yan.kun

Difficult to tell. A sln file is quite simple structured, if you open it with a text editor, check is everything looks all right to you.

很难说。sln 文件的结构非常简单,如果您使用文本编辑器打开它,请检查是否一切正常。

Seems to me that the sln file could be in a conflicted state.

在我看来,sln 文件可能处于冲突状态。