简体   繁体   English

Visual Studio 2012,无法加载项目文件

[英]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. 我正在使用Visual Studio2012。我的系统异常关闭,并且当时Visual Studio正在运行。 After then Im facing strange issue, my project file is not loaded and visual studio says, file not loaded. 之后,我面临一个奇怪的问题,我的项目文件未加载,Visual Studio说,文件未加载。 It is also showing me an html file, UpgradeLog.htm. 它还向我显示了一个HTML文件UpgradeLog.htm。 In this file, its showing me this error: HttpServerTest\\HttpServerTest.csproj: Error on line 1. Expected '<' but found 'null character'. 在此文件中,它向我显示此错误:HttpServerTest \\ HttpServerTest.csproj:第1行出现错误。预期为“ <”,但找到了“空字符”。

Not sure how to fix this, tried following solution by removing .suo file but its not working for me 不确定如何解决此问题,请尝试通过删除.suo文件以下解决方案,但对我不起作用

http://www.howtosolutions.net/2013/02/solving-project-file-error-could-not-find-part-of-the-path-with-visual-studio/ 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. 奇怪的是,它没有打开我的program.cs文件,但是显示的是正确的文件大小。 But when I try to open program.cs file, its opening an empty file. 但是当我尝试打开program.cs文件时,其打开了一个空文件。

Any idea? 任何想法?

thank you 谢谢

Try deleting .suo files in your solution folder. 尝试删除解决方案文件夹中的.suo文件。 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. 我今天在Visual Studio 2013中遇到了这个问题。 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). 原来,我们在* .csproj文件的开头以某种方式获得了一个不可见的字符(我们认为它是从错误的合并中到达的)。

We used https://www.xmlvalidation.com/ to find the invisible character: 我们使用https://www.xmlvalidation.com/查找不可见的字符:

    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. 在Notepad ++中打开* .csproj文件,转到第一行的开头,然后退格,删除该字符并允许Visual Studio正确加载项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Visual Studio 2012中动态加载另一个项目中的类? - How can I dynamically load classes from another project within Visual Studio 2012? 如何在我的Visual Studio 2012项目中引用XML文件作为项目代码中的数据源? - How can I reference an XML file in my Visual Studio 2012 project as a data source in my project code? Visual Studio 2012不会在使用通配符包含的项目中加载文件 - Visual Studio 2012 does not load files in a project included using wildcards Visual Studio 2012项目-无法加载&#39;Newtonsoft.Json&#39; - Visual studio 2012 project - Not able to load 'Newtonsoft.Json' Visual Studio 2010项目到Visual Studio 2012 - Visual Studio 2010 project to Visual Studio 2012 无法在Visual Studio 2012中加载文件或程序集,C# - Could not load file or assembly in Visual Studio 2012, C# 在 Visual Studio 2012 中的 C# 项目中更改文件完整路径 - Change file full path in a C# project in Visual studio 2012 符号文件未加载用于在 Visual Studio 2012 中调试自定义项目 - Symbol file not loading for debugging custom project in Visual Studio 2012 无法在visual studio 2012中打开mvc4项目? - Can not open mvc4 project in visual studio 2012? 我无法在Visual Studio 2012上执行项目 - I can't execute a project on Visual Studio 2012
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM