9

I've Visual Studio 2017 community edition. I have a C# project created using Visual Studio 2015. When I try to open the project in VS 2017 I get an error message prompt:

--------------------- Microsoft Visual Studio


Project 'dataStructureInCSharp' could not be opened because the Visual C# 2017 compiler could not be created. Please re-install Visual Studio.

--------------------------- OK

I'm trying to obtain help if anyone else has faced similar issue. I feel going the uninstall and then reinstall route is very costly for me and would try that option last if I've got no other resort.

What I've done so far :

  • Tried starting visual studio with administrative privileges

But problem remained same.

I tried creating a new console project solution from scratch but in that case I get very same error and an additional error error also shown below:

enter image description here

System Environment: Windows 7 Ultimate Service Pack 1

4
  • yeah. that's the obvious last resort. Commented Aug 16, 2017 at 2:39
  • 1
    @RBT, close VS 2017 and delete the folder %localappdata%\Microsoft\VisualStudio\15.0_xxxx\ComponentModelCache, then open VS to create a new Console project, if not works, re-run the VS 2017 installer as administrator, click the icon beside ‘Launch’ button and choose ‘Repair’ to repair. Commented Aug 16, 2017 at 9:10
  • I'm really sorry @Sara-MSFT. I got impatient in the morning itself as I was not getting any headway or a response. So, I simply uninstalled whole VS 2017 community and reinstalled it again to sort out my problem. Now, I'm not in a position to try the solutions suggested by you. Still I recommend that you add your suggestion as an answer. I'm sure it would be helpful for the future readers of this post who face same problem. Commented Aug 16, 2017 at 16:04
  • @RBT, so glad to hear that your issue is solved and thank you for your update, I added my reply and hope it will helpful for other community members who meet the same issue in the future :) Commented Aug 17, 2017 at 1:20

2 Answers 2

22

You can try to close all VS 2017 instances and delete the folder %localappdata%\Microsoft\VisualStudio\15.0_xxxx\ComponentModelCache, then open VS to create a new Console project.

Or

please re-run the VS 2017 installer as administrator, click the icon beside ‘Launch’ button and choose ‘Repair’ to repair as shown below:

enter image description here

Sign up to request clarification or add additional context in comments.

4 Comments

Deleting the folder was enough for me, my solution could successfully be opened afterwards. There was no need for a repair installation.
I've had the same issue on Win10 and was able to fix it with this solution. Though, it will reset all your settings and remove all your installed VS extensions.
That's really funny, I came to this question just because of the repair in the installer :)
Not sure which of the two suggestions in this answer @Vishal took, but deleting ComponentModelCache didn't affect my keyboard shortcuts or extensions on Windows 10 (nor did it solve the problem, unfortunately).
0

Just to brief the history of my problem, I had first installed Visual Studio(VS) 2017 community when it was in RC stage. This was first time when I saw the workload based UI of visual studio installation. Initially I simply chose .Net desktop development workload to get started as I was interested in creating only console applications to get my hands dirty.

Initially it was all working well. One fine day I added all other workloads I was interested in namely Universal Windows Platform Development, Azure Development, ASP.NET and web development,Node.js development, and Mobile development with .Net. I'm not sure if there any of the specific workloads to be blamed for the issue I've posted.

Just to avoid the case if RC and RTM release builds might not have messed up my entire environment, I simply uninstalled the entire stuff, rebooted my machine and installed it again from scratch from latest RTM release for Visual Studio Community.

I would strongly recommend that you first try possible solutions suggested by @Sara-MSFT before doing clean reinstall just in case if it works. It can save you couple of hours required in whole reinstallation process if it works.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.