Plain C# Editor in Visual Studio 2012 (No intellisense, no indentation, no code highlighting)

C#.NetVisual StudioVisual Studio-2012

C# Problem Overview


I just installed visual studio 2012 in my machine, I previously had visual studio 2012 RC which I uninstalled before. The installation was successful, but after I open a project the C# editor is not working, is just like a plain text editor like this:

C# editor

I've tried repairing it, uninstalling it completely and then installing again, but no success.

Anyone have an idea?

I don't know if it is related, but I'm also getting this error sometimes when creating a new project or when opening an existing one:

Vs error

Thanks in advance

C# Solutions


Solution 1 - C#

I'm pretty sure the error about ManagedObjectFactory is related to the symptoms you are describing. This error indicates your Visual Studio installation (particularly the C# language service) is corrupted. Most likely this is caused by some setup issue, which we are currently working to identify.

I had a chance to investigate this error and found that one of our interop assemblies is unexpectedly installed into the GAC, while it shouldn't be. It's installed into the GAC by Windows installer, which indicates this is a setup issue. The fix is to uninstall it from the GAC, but because it's installed by Windows installer, it's more than just "gacutil /u". You need to follow the procedure described in KB873195 to remove it from the GAC:

  1. Delete a value corresponding to the “Microsoft.VisualStudio.CSharp.Services.Language.Interop” assembly from the "HKLM\SOFTWARE\Classes\Installer\Assemblies\Global". Note the "Interop" part because there is also Microsoft.VisualStudio.CSharp.Services.Language assembly, which must be in the GAC.
  2. Start "VS2012 x86 Native Tools Command Prompt" and run "gacutil /u Microsoft.VisualStudio.CSharp.Services.Language.Interop".

Disclaimer: I'm a dev on the Visual Studio C# IDE team.

Solution 2 - C#

It may be that some of the settings are disabled in visual studio. Check the following settings:

Tools->Options->Text Editor->C#->General->Auto list members
Tools->Options->Text Editor->C#->General->Parameter information

EDIT:

Also check

Tools->Options->Text Editor->C#->Intellisense->
Show completion list after a character is typed

Here is an article on ScottGu's blog which can be helpful:D

Second EDIT:

There is one more article on ScottGu's blog titled No Intellisense with VS 2010 RC (and how to fix it). Let me know if that helps. The patch is available here.

Third Edit:

Tools –> Import and Export Settings ->  Reset all Settings

You can backup the old settings if you want. This solution is for visual studio 2012. I believe this should work

Fourth Edit: Instead of changing it for only C#, change it for all the languages

Tools > Options > Text Editor > All Languages

In general, ensure that the checkboxes in the Statement Completion section are actively checked (not grayed out). There is a possibility of having a blue square rather than a tick mark. As the tick boxes are 3 state, the square meant that "Partial Selection" was in effect. Once the tick mark is in effect, restart Visual Studio and try it again.

Final Edit:

Looks like the installation is missing some files. I would advise you to download a fresh copy of the software and install it from scratch, with the default settings active.

Solution 3 - C#

I just had the same issue as you and followed the instructions I found here.

The part I found that worked was:

  1. Try running devenv /Resetsettings in Command Prompt to eliminate the cause of corrupted settings.
  2. Try running devenv /ResetSkipPkgs in Command Prompt.
  3. Try running devenv /Safemode in Command Prompt to see if you can apply it correctly.
  4. Try running devenv /Resetuserdata in Command Prompt to reset all of your VS environment and customization settings.

Solution 4 - C#

Try deleting:

  • %appdata%\Roaming\Microsoft\Microsoft Visual Studio
  • %appdata%\Roaming\Microsoft\VisualStudio
  • %appdata%\Local\Microsoft\VisualStudio

This should erase all of your visual studio settings (from all versions) and restore it to default, in case some old settings were left behind by the RC that the RTM doesn't like.

Edit:

Also you want to remove

  • My Documents/Visual Studio 2012/Settings

Solution 5 - C#

If you have vs2012 installed in another disk(say disk D:) than the RC(installed on disk E:), try copying E:\Program Files\Micosoft Visual Studio 11 to the corresponding folder on D:.

Solution 6 - C#

If you have any RC version it might be the cause.

I had this issue with Visual Studio 2012 Developer Edition. I later found that i have Express Edition RC, i removed it and it solved the problem.

And then i applied eggie's solution

Solution 7 - C#

Well, I still don't know what was the problem, but solved it by uninstalling visual studio 2012 final, then installing visual studio 2012 RC, and then without uninstalling RC installed again the final version.

Thanks everyone for your help.

Solution 8 - C#

Neither Oleg's solution (or variations suggested in the comments) or Repairing Visual studio worked for me. I finally stubmbled upon a fix shown here

So 3 simple steps:

  1. Close all instances of Visual Studio

  2. run Developer Command Prompt for VS2012 (search in the Start Menu) as Administrator

  3. Then type devenv.exe /setup

That did it for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEscobar5View Question on Stackoverflow
Solution 1 - C#Oleg TkachenkoView Answer on Stackoverflow
Solution 2 - C#reggieView Answer on Stackoverflow
Solution 3 - C#RusView Answer on Stackoverflow
Solution 4 - C#PhonicUKView Answer on Stackoverflow
Solution 5 - C#Cheng ChenView Answer on Stackoverflow
Solution 6 - C#Shrage SmilowitzView Answer on Stackoverflow
Solution 7 - C#Escobar5View Answer on Stackoverflow
Solution 8 - C#Serj SaganView Answer on Stackoverflow