修复 "Unrecognized Version" .sln 文件

最近几天在写一些demo程序过程当中,发现了一个让我头疼的事情。在VS2010下建了几个解决方案(i.e. Solution),写好程序后,将代码提交到Git仓库中,结果从另外一台电脑上clone出来后,发现全部的solution文件全变成了 “Unrecognized Version”, 直接双击打不开解决方案了,只能经过右键选择Open with Visual Studio 2010或在Visual Studio中打开。Visual Studio Version Selector已经全然认不出这个解决方案了。git

几经周折,缘由多是在push到git仓库的时候solution文件时,丢失了UTF8 byte order mark。blog

So far, the problem I’ve seen with all the broken files is the lack of a UTF8 byte order mark at the beginning of the file.ci

这个时候不管怎么修改那个.sln文件也不能找回version信息。其实要找回version信息,咱们只要用Visual Studio先打开这个解决方案,而后作一些能够让Solution发生变化的事情,好比修改一些配置,而后所有保存,version信息就神奇的回来了。get

参考:http://scientificninja.com/blog/fixing-unrecognized-version-sln-filesit

相关文章
相关标签/搜索