打开Visual Studio 2010解决方案在Visual Studio 2013中

打开Visual Studio 2010解决方案在Visual Studio 2013中

问题描述:

我有一个解决方案文件,在解决方案的左下角有10个。我的电脑上只安装了VS2013。任何时候,我尝试打开该解决方案,我得到这个错误:打开Visual Studio 2010解决方案在Visual Studio 2013中

One or more projects in the solution were not loaded correctly
Please see the Output Window for details

,并在输出窗口中的细节是:

C:\Users\Desktop\ERT - ERT-sdk\C#\4.0\Sample.csproj : error
The project file could not be loaded.
Data at the root level is invalid. Line 1, position 1.
C:\Users\Desktop\ERT - ERT-sdk\C#\4.0\Sample.csproj

什么我需要改变,所以我可以加载解决方案和项目VS2013中PC上的文件?

编辑
以下是sample.csproj文件的前7行。如果需要更多线路,请告诉我,谢谢!

<?xml version="1.0" encoding="utf-8"?> 
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
<PropertyGroup> 
<ProjectType>Local</ProjectType> 
<ProductVersion>9.0.21022</ProductVersion> 
<SchemaVersion>2.0</SchemaVersion> 
<ProjectGuid>{90CCE281-D71C-4EA6-9C17-A3C052B583D4}</ProjectGuid> 

EDIT 2
上www.w3schools.com/xml/sml_validator.asp它抛出Error运行它通过一个XML语法检查:

Error on Line 1 at column 6: 
XML declaration allowed only at the start of the document 
+0

较新版本的VS通常可以打开较旧的项目文件。当你看着它所抱怨的那一行时,你是否看到有关内容的奇怪事情?也许粘贴文件的前几行? –

+0

@MattiVirkkunen - 它会是解决方案文件的前几行吗? Sample.csproj? –

+0

错误消息提到Sample.csproj,所以它可能是该文件。 –

消息指向错误垃圾字节在文件的开头。可能是重复或双重编码的UTF-8字节顺序标记。

使用二进制安全编辑器(如十六进制编辑器)删除垃圾字节,你应该很好。

甚至只是制作一个副本,在一个肯定会忽略这些字符的编辑器中打开它,并将整个内容复制并粘贴到原始文件中。

+0

您是否按照错误消息要求的方式执行操作,即右键单击列表中的卸载项目并单击“重新加载”?如果你使用在线十六进制编辑器编辑它并从浏览器保存它,它可能只是Windows的愚蠢的“这个文件从互联网上下载”非功能。 –

+0

就是这样,我结束了重新启动,并补救。 –