2016-04-27 293 views
0

我有一個解決方案文件,在解決方案的左下角有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,所以它可能是該文件。 –

回答

0

消息指向錯誤垃圾字節在文件的開頭。可能是重複或雙重編碼的UTF-8字節順序標記。

使用二進制安全編輯器(如十六進制編輯器)刪除垃圾字節,你應該很好。

甚至只是製作一個副本,在一個肯定會忽略這些字符的編輯器中打開它,並將整個內容複製並粘貼到原始文件中。

+0

您是否按照錯誤消息要求的方式執行操作,即右鍵單擊列表中的卸載項目並單擊「重新加載」?如果你使用在線十六進制編輯器編輯它並從瀏覽器保存它,它可能只是Windows的愚蠢的「這個文件從互聯網上下載」非功能。 –

+0

就是這樣,我結束了重新啓動,並補救。 –

相關問題