7

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 enter image description here

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. enter image description here

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.

https://social.msdn.microsoft.com/Forums/vstudio/en-US/966fb9d0-5423-4810-b03b-94a5417831a5/these-projects-are-either-not-supported-or-need-project-behavior-impacting-to-open-this-version-of?forum=visualstudiogeneral

https://www.aspforums.net/Threads/120933/Visual-Studio-Error-These-projects-are-either-not-supported-or-need-project-behavior-impacting-to-open-this-version-of-Visual-Studio/

NassimH
  • 462
  • 3
  • 13
Aks_M
  • 159
  • 1
  • 9
  • 1
    do not post links with images for starters.. please state what the error is because others will not nor do not know if the link(s) are Malicious or not in nature. thanks – MethodMan Dec 17 '18 at 20:37
  • Thanks for your comment! I had included the error in the main question so thought it should be fine. But also included the error message in the detailed description. But thanks again for your comments. – Aks_M Dec 17 '18 at 21:02
  • Some questions: 1) What type of project are you creating? Console Application? Web Application? 2) Have you tried to reproduce the error? E.g. create a new project again in a new solution? – Adrian Sanguineti Dec 17 '18 at 21:06
  • hate to ask the question, is this a licensed version or a hacked version you downloaded? also have you checked to see if there are any updates to the current version you are using.? – MethodMan Dec 17 '18 at 21:09
  • 1
    Hi Adrian, Thanks for your comments, It's a .NET core web application project. When I create a new project I don't get that error. but its just that when I was trying to open the same project that I previously created, it showed that error and the solution explorer does not show any files. – Aks_M Dec 17 '18 at 21:12
  • 1
    It's a licensed version. – Aks_M Dec 17 '18 at 21:13
  • ok @AkshayM , now that you have clarified, have you checked to see if VS has updates ? – MethodMan Dec 17 '18 at 21:46
  • 1
    Many thanks @MethodMan! I was able to see all my files in the solution explorer back again. Although my problem is solved, I would like to know the reason of that error and why just deleting the "csproj.user" file and reloading the project worked. – Aks_M Dec 17 '18 at 21:57
  • do you have a text editor like `notepad++` the reason I suspect would be the version, Visual Studio if you have more than one version you will understand what I am talking about in that regard, it probably was looking for a higher version and or when you opened the project? sometimes you get the conversion dialog to come up I hope I am making sense however I have seen this issue before glad you got it to work – MethodMan Dec 17 '18 at 22:01

3 Answers3

5

So, just in case anyone is interested to know, finally what worked for me is,

  1. DELETE THE csproj.user FILE that was there in my solution
  2. RELOAD the project

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.

Aks_M
  • 159
  • 1
  • 9
0

I got the same error after trying other methods this methods works like a charm for me.

  1. open Visual Studio Installer.
  2. click on modify.
  3. check Game Development With Unity.

install it and here you go.

enter image description here

Uzair
  • 714
  • 2
  • 6
  • 17
0

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:

  • The question here is related; the top-voted answer and the accepted answer suggest editing the .csproj file and changing the <ProjectTypeGuids>
    • be careful of changing the csproj; this might only be appropriate if you know what you're doing / using specific Project Type GUID values that are compatible with one another, (see details in the answers above, which seem specific to ASP.NET MVC 2)
  • The question here, which shows how to install the correct tooling depending on your project type (the question is here specific to ASP.NET MVC 5 and C#)
Nate Anderson
  • 18,334
  • 18
  • 100
  • 135