Visual Studio 2015 Broken Razor Intellisense

后端 未结 17 1136
陌清茗
陌清茗 2020-11-28 02:04

After installing and then repairing my VS2015 instance I still cannot get intellisense (server side) to work in my MVC views. I get alerted by message promp

相关标签:
17条回答
  • 2020-11-28 02:22

    Might have happened due to having ReSharper.

    It will be fixed in future versions, but as of now (version 10.0.2), it is broken. ReSharper overrides the IntelliSense of Visual Studio and therefore it will not work, which also explains why running devenv.exe /ResetUserData fixes it since it removes ReSharper.

    Manually return the IntelliSense power to VS through the menu:
    ReSharper >> Enviroment >> IntelliSense >> Fill the following:

    And this is how the IntelliSense from VS should look:

    0 讨论(0)
  • 2020-11-28 02:23

    This has been recurring for me also and seems to be connected to extension updates but I have not yet been able to blame anything specific. What I have been able to discover is a less intrusive resolution.

    In my case deleting the contents of this directory allows the IDE to recover:

    %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache

    Edit: I just came across this one which might be handy too - Clear MEF Component Cache (Open VSIX Gallery)

    0 讨论(0)
  • 2020-11-28 02:23

    There is another solution, without reset all user data

    (but only window layouts/toolbars):

    close all VS2015 instances, [eventually backup, and] delete the folder:

    "[User Directory]\AppData\Roaming\Microsoft\Visual Studio\14.0"
    

    Now, re-open VS2015: layout was reset to factory preset, but Razor syntax would work

    0 讨论(0)
  • 2020-11-28 02:27

    This might sound funny but just to do one thing..

    Put Breakpoint on any line and then wait for 5 seconds of that do not work then go to first line and put break point there and as you put break point it will ask for break point settings. click on that settings and close that settings. Done. you intellisense is now working.

    I have VS 2015 Community edition.Previously had VS 2015 Enterprise and it happened on that but after getting community i found that same happens and same solution work for both.

    I found that solution by accidently during work.Also do that when project is not running.and you can remove that break point also.

    0 讨论(0)
  • 2020-11-28 02:29

    The /ResetUserData solution is your best bet, but I also think I have found out a possible cause of this...

    I am currently using Umbraco to create Macro Partials in the BackOffice. When these files get created I click on the Hide/Show all files button to show the Macro Partial in my solution and the Razor Syntax Highlighting seems to stop working so my guess is new files introduced into your solution that aren't created directly through VS cause this issue.

    Even when adding the files to the solution the Syntax Highlighting doesn't work.

    0 讨论(0)
  • 2020-11-28 02:29

    Mine was a slight pain in the keester but seemed to work. In my case it was a .aspx File that wouldn't do intellisense anymore (after I stupidly changed the .aspx filename...lesson learned!)

    1. I copied all my code out of the files (.aspx & .cs) into notepad for example.
    2. Deleted the .aspx file (which in turn deleted all child files).
    3. Saved my project. Created a new .aspx file with the same name.
    4. Copy/pasted my code from notepad.
    5. Saved it.
    6. Tried intellisense again. It worked!

    Round about way but not as bad as uninstalling/vs reinstalling which is TOTALLY overkill. Good luck everyone! Hopefully MS will get this fixed one of these years!

    0 讨论(0)
提交回复
热议问题