Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 27-Oct-16 22:18pm
Comments
RedDk 28-Oct-16 14:00pm    
Try deleting the .suo and/or .pch and/or .sdf ... the local paths disappear when opening the solution or project file so VS defaults to THIS location.

CSPROJ files are XML - so the error is relating to the header for the XML file, which should look something like this:
XML
<?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.
 
Share this answer
 
You may have to reconstruct the entire project from scratch. Create a new solution and copy all the projects/code into it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900