Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 941
Escobar5 Avatar asked Aug 16 '12 13:08

Escobar5


People also ask

Why is C called C?

After language 'B', Dennis Ritchie came up with another language which was based upon 'B'. As in alphabets B is followed by C and hence he called this language as 'C'.

Is C still used?

Despite the prevalence of higher-level languages, C continues to empower the world. The following are some of the systems that are used by millions and are programmed in the C language.

What language is a successor of C?

C++ emerged from the C language foundation, becoming the first widely used object oriented programming languages. Although Java, C# and other similar “managed” languages have become fast enough to offer an alternative to C for high speed computing, most operating systems and compilers remain written in C or C++.

What language is C written in?

It was based on CPL (Combined Programming Language), which had been first condensed into the B programming language—a stripped-down computer programming language—created in 1969–70 by Ken Thompson, an American computer scientist and a colleague of Ritchie.


1 Answers

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.

like image 88
Oleg Tkachenko Avatar answered Sep 28 '22 01:09

Oleg Tkachenko