Reputation: 179
I created a project in Visual Studio 2017. It worked all fine when I initially created it. The next time when I tried to open the same project it gave an error as shown below
I had created that project in Visual studio 2017 itself and the next time as well I tried to open it with visual studio 2017. So doesn't seem to be a version related problem.
Also, I did not make any changes to the project after it worked last time. And when I click "OK", the solution does not load. Below is what in solution explorer.
I tried to research this error a bit and came across some links as below as even I am getting the exact same error as mentioned in those links. But those links didn't really help me. I tried to reload the project solution, but that didn't work.
Upvotes: 7
Views: 6411
Reputation: 21034
This problem happens because of the XML element inside the .csproj
file (if you open as text / edit the csproj file directly)
<ProjectTypeGuids>
See related questions here:
.csproj
file and changing the <ProjectTypeGuids>
<ProjectTypeGuids>
against this lookup table, to find out what project type(s) your project is, so you can find better information how to supportUpvotes: 0
Reputation: 775
I got the same error after trying other methods this methods works like a charm for me.
install it and here you go.
Upvotes: 1
Reputation: 179
So, just in case anyone is interested to know, finally what worked for me is,
And I got the hint from https://forums.asp.net/t/1491251.aspx?Can+t+load+project+because+root+element+is+missing+
Thank you all those who helped me with my issue. Although I was able to solve my problem, if anyone knows, I would like to know the reason why I got that error and why just deleting the csproj.user file and reloading the project loaded my solution all good.
To add to this, when I created this solution initially and it worked all fine, I then shared it with my team member and that team member opened the project all fine and then shared it back to me without any changes. And then when I tried to open it again, I was unable to open the project.
Upvotes: 5