Visual Studio 2015 not syntax highlighting razor nor Intellisense

59,882

Solution 1

I've found in this answer another way to fix it without the devenv.exe /ResetUserData

Just delete the contents of this directory with Visual Studio closed: %LocalAppData%\Microsoft\VisualStudio\<visual_studio_version_number>\ComponentModelCache

To find the version number of the Visual Studio edition your are running please refer this list. Note that only the major number is important, the minor version can and will probably differ. In my case I had Visual Studio 2017 Enterprise installed so I looked for 15.xx and found 15.0_9a1c4a06 inside the AppData folder.

Solution 2

I had the same problem, the only fix so far is by resetting all user data (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe /ResetUserData).

NOTE: You will lose all customizations, e.g. keyboard shortcuts and window layouts if you do this!

EDIT: People are saying this only works for RC, not RTM, so you might want to try the other fixes first.

Solution 3

I had the same problem in VS 2015 RTM and was able to fix it by simply loading Visual Studio in Safe Mode by:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe /SafeMode

then closing and reopening it normally.

Solution 4

After Updating Visual Studio 2015 Update 1 I had same issue. I tried all the answers but did not work for me.

The fix for me was going to programs and properties > Visual Studio community edition > Change. I clicked on modify.

In the list make sure to put a check mark on "Microsoft Web Developer Tools" under "Windows and Web Development" .

It was not checked in my list howewer :/

enter image description here

Solution 5

Tools > Options > Text Editor > All Languages > General. Uncheck the Hide advanced members option. Click OK.

Once I did that Intellisense seemed to work for me. I then reset it back and kept functionality. I'm using Visual Studio 2015 enterprise edition.

I had tried ResetUserData and that did not work for me.

Share:
59,882
DLeh
Author by

DLeh

I am a Manager and Senior Developer at ASI. I have 10 years of experience in C# and Full Stack development, and I specialize in creating robust API platforms. I have a passion for making reliable code that is testable and sharable between applications. I graduated Messiah University graduate 2010 with Bachelors in Computer Science.

Updated on February 04, 2020

Comments

  • DLeh
    DLeh over 4 years

    My Razor views in VS2015 RC are not showing the proper coloring for C# code. My project was working fine in VS2013, but it isn't in 2015, and it's not giving me any Intellisense on the C# code. The solution builds and the site runs fine.

    I tried the following to no avail

    • disabling all Visual Studio extensions
    • deleting my .suo file
    • removing the project and re-adding it to the solution

    How can I fix this?

    Example:

  • DLeh
    DLeh almost 9 years
    While this probably isn't the best solution, it worked for me! Thanks! I'm wondering if it had anything to do with having previous CTP versions installed.
  • quadroid
    quadroid almost 9 years
    you can export the keybindings before, and restore them afterwards
  • Nicholas Petersen
    Nicholas Petersen almost 9 years
    Is the '>' caret right in that command line? It worked for me by replacing that with a backwards slash. But this solution then worked for me as well!
  • Knerd
    Knerd almost 9 years
    And you loose all Addons.
  • Zeeshan
    Zeeshan over 8 years
    I have Enterprise version (VS 2015). is there any possible solution for this version? above solution did not work for me.
  • Nick
    Nick over 8 years
    It did work for me though, it's worth trying. You won't lose your current settings.
  • Steve French
    Steve French over 8 years
    Also have the enterprise version - it did not work for me either.
  • Shawn
    Shawn over 8 years
    Well it worked then it went right back to not working
  • chrilith
    chrilith over 8 years
    This is indeed the problem for me and /resetuserdata doesn't help :(
  • Todilo
    Todilo over 8 years
    This didnt work for me with c#. However I wen tto Text Editor > C# and checked / then unchecked "Hide advanced members" then pressed ok and intellisense started working again.
  • T-moty
    T-moty over 8 years
    This didn't work for me, that error show up also in SafeMode (and obviously after re-opening in the "standard" way).
  • grmbl
    grmbl over 8 years
    Thanks for saving me from losing my settings!
  • Tamim Al Manaseer
    Tamim Al Manaseer over 8 years
    Worked on my VS 2015 Enterprise
  • Diego
    Diego over 8 years
    Awesome! worked for me too. Worth trying, I used to blow out my settings on the last few occasions.
  • hal9000
    hal9000 over 8 years
    this worked for me (full release) VS 2015 Enterprise edition
  • Micaël Félix
    Micaël Félix over 8 years
  • dotnetmensch
    dotnetmensch over 8 years
    This has happened to me twice and the first time I reset all my settings. This time I tried this and it work for me.
  • Toft
    Toft over 8 years
    This worked for me. VS 2015 Enterprise Version 14.0.23107.0 D14REL
  • Paul Carroll
    Paul Carroll over 8 years
    this worked for me too and was far preferable to resetting my environment!
  • Justin Skiles
    Justin Skiles over 8 years
    Sometimes this works and sometimes it doesn't. It fixed it for me for about 5 minutes then it started happening again.
  • Justin Skiles
    Justin Skiles over 8 years
    It has nothing to do with MVC4. Projects with MVC5 and 6 still suffer from these issues.
  • Justin Skiles
    Justin Skiles over 8 years
    Had no effect for me. VS2015 Professional.
  • Ogglas
    Ogglas over 8 years
    I'm using VS2015 Community. Have you tried Geir Sagbergs solution? In CMD run: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe" /ResetUserData
  • Justin Skiles
    Justin Skiles over 8 years
    Yes. I've tried every solution in every thread on StackOverflow. Nothing has worked. I've even re-installed VS and my operating system.
  • Ogglas
    Ogglas over 8 years
    If you create a new console project after reinstall, wont it work there?
  • Timber
    Timber over 8 years
    Works for me! Visual Studio 2015 Enterprise.
  • Marc-Andre R.
    Marc-Andre R. over 8 years
    Didn't work for me. Reinstalling Web Tools manually fixed everything. You can get them here : microsoft.com/en-us/download/details.aspx?id=48222
  • ShurikEv
    ShurikEv over 8 years
    Works for me without uninstall "Productivity Power Tools 2015". Visual Studio 2015 Enterprise.
  • kapsiR
    kapsiR over 8 years
    Thanks. That's the better way instead of reset all user data in VS2015 Enterprise
  • Law
    Law over 8 years
    Worked for VS 2015 Enterprise
  • Justin Skiles
    Justin Skiles over 8 years
    @Marc-AndreR. Tried that. I even tried updating VS2015 Update 1. It didn't do anything.
  • Bruno
    Bruno over 8 years
    I Had bunch of problems after updating VS2015 PRO to update 1 (including syntax highlighting) and the /reserUserData + /safeMode described by @kevin just did the trick
  • batressc
    batressc over 8 years
    »» Worked on my VS2015 Enterprise Ver. 14.0.23107.0 D14REL »» Initial NET Framework: 4.5; after update: 4.6 »» Administrator mode & Normal mode: Ok
  • Tony_Henrich
    Tony_Henrich over 8 years
    It keeps getting checked after I uncheck it
  • sobelito
    sobelito over 8 years
    Worked for Professional. Tried the Safe mode, which worked and then stopped working. Tried settings reset and that did nothing for me.
  • cdie
    cdie over 8 years
    This should be the main solution, worked for me too on VS 2015 entreprise
  • Jón Viðar Þorsteinsson
    Jón Viðar Þorsteinsson over 8 years
    This worked for me, and I agree this should be the main solution. I´m using the Professional version. Thank you very much.
  • mclark1129
    mclark1129 over 8 years
    Worked for me in 2015 Enterprise
  • mituw16
    mituw16 about 8 years
    Worked for VS2015 Professional
  • Tony Lin
    Tony Lin about 8 years
    my intellisense gone after installed an extension. Finally got it fixed by taking this solution.
  • Aldracor
    Aldracor about 8 years
    Yay! Worked for me thanks! (using VS2015 Professional Update1)
  • lostatredrock
    lostatredrock about 8 years
    This worked for me as well, I had an MVC4 site I had been working in VS2013 because of the lack of support until Update 1. After Update 1 was installed it was still not working in 2015, but uninstall and re-install of the packages from Nuget solved the problem.
  • X3074861X
    X3074861X about 8 years
    I had an issue where the intellisense menu would pop up for a split second then disappear - this solved that problem, and now the menu stays visible as expected.
  • Jon
    Jon almost 8 years
    Worked with VS 2015 Enterprise
  • PHenry
    PHenry almost 8 years
    Unfortunately when I tried this, the checkmark just came back. :< It refused to go away. :< Still stuck with this problem. :< Very ticked off at VS right now. :< huge time sink.
  • Admin
    Admin almost 8 years
    Take a look here: stackoverflow.com/questions/33245041/… The symptoms are the same. I solved this issue by installing .NET Core 1.0.0
  • Lütfullah Kus
    Lütfullah Kus over 7 years
    That folder is empty on my pc.solved after using the clear tool
  • Kemâl Gültekin
    Kemâl Gültekin over 7 years
    Tried almost every other solution, this did th trick for me. (VS 2015 community)
  • Sadik Ali
    Sadik Ali about 7 years
    This is best solution for ever, no need to install any other components.its worked for me. Thanks dude.
  • Joseph
    Joseph about 7 years
    Worked for Visual Studio 2015 Community Edition. Thanks!
  • RMuesi
    RMuesi almost 7 years
    this is what i eventually found out to be the cause. My project was MVC 3. VS 2015 doesn't support MVC 3. Nothing else i tried worked.
  • Deathstalker
    Deathstalker over 6 years
    This fixed my issue at least for right now. It might not continue to work but we shall see. Seems like an odd error and something Microsoft should fix. This issue was in both 2015 and 2017
  • Hans Derks
    Hans Derks over 5 years
    Worked with VS 2017 Enterprise
  • Rudy Scoggins
    Rudy Scoggins over 4 years
    This worked for me. I had to manually delete some items in the Razor-Server folder as well that were being locked up in the compile process.