项目显示无法找到根元素 [英] Project showing can't find root element

查看:68
本文介绍了项目显示无法找到根元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试打开我昨天工作的项目,但令人惊讶的是,该项目显示无法找到根元素xxxxx.csproj。这个文件夹存在于我的项目中,它的大约53kb。不知道为什么找不到它



我尝试过:



我打开xxxx.csproj文件,j在那里显示Null Null。我回到了我的备份(备份是在3个月前的最后更新)。并复制xxxx.csproj文件的内容并粘贴它。我试图重建解决方案,但我没有收到关于我在整个问题开始之前修改过的一些丢失文件的一系列错误

I tried opening a project that I was working on yesterday today but surprisingly, the project is showing cannot find root element xxxxx.csproj .This folder exist in my project and its about 53kb. Don't know why it cannot locate it

What I have tried:

I open the xxxx.csproj file and j found Null Null displayed there. I went back to a back up with I had(the back up was last updated about 3 months ago). and copied the content of the xxxx.csproj file and pasted it. I tried to rebuild the solution but I'm not getting series of error about some missing files which I have modified before the whole issue started

推荐答案

CSPROJ文件是XML - 所以错误与XML文件的标题有关,它应该如下所示:

CSPROJ files are XML - so the error is relating to the header for the XML file, which should look something like this:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
     ...

如果没有 - 并且您可以使用文本编辑器(如记事本)进行检查 - 那么它已损坏,这就是导致错误的原因。
它如何变得腐败,我们不知道 - 它可能是硬件故障,也许是软件故障:我强烈建议在硬盘驱动器上运行完整性测试以检查它们是否存在问题因为这样不会变得更好,它们会变得更糟,而且通常很快。非常快。



检查你的备份(三个月是备份之间的过长时间)然后查看文件。如果这看起来不正确,但你的硬盘看起来还不错,我建议创建一个新的解决方案并将所有现有的源文件导入到该文件中,看看是否有效。

If it doesn't - and you can check using a text editor like Notepad - then it's corrupt, and that is what is causing the error.
How it became corrupt, we have no idea - it may be a hardware fault, it maybe a software glitch: I'd strongly recommend running an integrity test on your hard drive(s) to check them for problems as such do not get better, they get worse and generally quickly. Very quickly.

Check your backup (and three months is an excessive time between backups) and look at the file then. If that doesn't look right either, but your HDD looks ok, I suggest creating a new solution and importing all the existing source files to that and see if that works.


你可能有从头开始重建整个项目。创建一个新的解决方案并将所有项目/代码复制到其中。
You may have to reconstruct the entire project from scratch. Create a new solution and copy all the projects/code into it.


这篇关于项目显示无法找到根元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆