简体   繁体   中英

Visual Studio 2012, can not load project file

I am using visual studio 2012. My system was shutdown abnormally and visual studio was running at that time. After then Im facing strange issue, my project file is not loaded and visual studio says, file not loaded. It is also showing me an html file, UpgradeLog.htm. In this file, its showing me this error: HttpServerTest\\HttpServerTest.csproj: Error on line 1. Expected '<' but found 'null character'.

Not sure how to fix this, tried following solution by removing .suo file but its not working for me

http://www.howtosolutions.net/2013/02/solving-project-file-error-could-not-find-part-of-the-path-with-visual-studio/

Strange thing is, Its not opening my program.cs file, however its showing correct file size. But when I try to open program.cs file, its opening an empty file.

Any idea?

thank you

Try deleting .suo files in your solution folder. Solution User Option file is a binary file which contains various user information and settings such as location of the breakpoints.

尝试创建新的解决方案文件,然后添加现有的项目文件(或文件夹)...

如果您有项目的任何备份,请尝试将.csproj文件的内容复制到当前文件中

I ran in to this with Visual Studio 2013 today. It turned out we had somehow gotten an invisible character at the beginning of our *.csproj file (we think it got there from a bad merge).

We used https://www.xmlvalidation.com/ to find the invisible character:

    1   &#65279;<?xml version="1.0" encoding="utf-8"?>

Opening the *.csproj file in Notepad++, going to the beginning of the first line, and backspacing, removed the character and allowed Visual Studio to correctly load the project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM