Plain C# Editor in Visual Studio 2012 (No intellis

2019-01-16 12:15发布

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

8条回答
家丑人穷心不美
2楼-- · 2019-01-16 12:34

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.

查看更多
仙女界的扛把子
3楼-- · 2019-01-16 12:38

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.

查看更多
时光不老,我们不散
4楼-- · 2019-01-16 12:43

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.

查看更多
Bombasti
5楼-- · 2019-01-16 12:46

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:.

查看更多
贪生不怕死
6楼-- · 2019-01-16 12:49

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.

查看更多
ゆ 、 Hurt°
7楼-- · 2019-01-16 12:59

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.
查看更多
登录 后发表回答