Visual Studio 2013 IntelliSense stops working for ASP.NET MVC5 Controllers
Asked Answered
C

26

132

I am facing a weird problem in my Visual Studio 2013 ASP.NET MVC 5 project. All of a sudden, the IntelliSense in the Controller classes of the MVC 5 project are not working at all.

I have other class library projects in my solution and IntelliSense is working in those class library project files, but the problem is only within the MVC project. Usually these kinds of problems are solved by restarting Visual Studio: not only did I restart Visual Studio, but I also restarted my computer, and the IntelliSense problem is not getting fixed at all.

Are there any other steps that can get me IntelliSense back?

Claudication answered 31/1, 2014 at 3:27 Comment(0)
C
26

I have found one way to solve the problem. That is, 1. -> Remove the ASP.NET MVC Project from Solution, 2. -> Then, add the MVC Project back to the Solution.

By doing these steps, I can get the Intellisense again. But, I am not happy with this solution though, because, next time when I double click the Solution file to open the solution, I see the intellisense is not working again. I would like to know the real reason why it is behaving like that.

EDIT:

Finally, I figured out that it was a 3rd party visual studio extension which was causing the problem. In order to find out that extension, I removed all extensions and then, added the extensions one by one and stopped where I found the culprit extension that was taking my sleep away :).

Claudication answered 1/2, 2014 at 2:32 Comment(8)
Been dealing with this for a month and it's driving me crazy. Removing and readding from the solution (although a pain) did work for me too. Thanks!Gabel
Which extension was to blame?Weiland
In my case, it was Xamarin extension, but I do not want to say bad about Xamarin, because, their customer support is super excellent. As soon as I reported the problem, they provided me the fixed version quickly. Moreover, the most recent version of Xamarin extension does not seem to have that problem anymore. My point is, any extension's specific version can cause such problem, we may need to uninstall the extensions one by one to find out which is causing the problem. For example, a future version of today's good extension can cause such problem too. We need to watch out in that case.Claudication
Unloading the project and reloading it worked for me too thankyou!Breskin
You should also try this if you got at this point and nothing works: https://mcmap.net/q/172489/-visual-studio-2013-intellisense-stops-working-for-asp-net-mvc5-controllersGiorgio
That's for this, it really helped me out. It's still a pain, but it's much less a pain then closing out VS completely. I run a plain version with only 1 added extention which is AnkhSVN, that I can't remove.Hexagonal
In my case it was the Xamarin extension. Uninstalled it and the problem went away. This was the latest version too!Stock
I had the same issue with the Xamarin extension, but for some reason only with one particular project. It was an expired trial so I just uninstalled it and syntax highlighting came back.Paleography
R
209

Close Visual Studio. Delete the <ProjectName>.v12.suo file. Reopen solution.

Resuscitate answered 1/6, 2014 at 19:57 Comment(8)
Thanks for the info. I will try this trick next time if my Visual Studio intellisense stops working again.Claudication
I've found that deleting the suo file fixes a lot of issues. It's like the Visual Studio equivalent of a reboot. Thanks for reminding me.Goy
Yep... fixed the issue for me right now. My ProjectName.v12.suo was 982 KB in size. Deleted it. Closed the solution. Reopened the solution and a new ProjectName.v12.suo got created. Intellisense is back again but this new .suo file is only 500 KB in size now. Really interesting. Maybe Microsoft should fix this bad behaviour? Somehow it causes VS to lose Intellisense and it's really a pain to work without it. :)Giorgio
Did not work for me. What worked for me was resetting my settings.Cusec
This fixes the IntelliSense problem but you also loose all breakpoints, bookmarks etc. at the same time.Hent
Hmm. I don't have any .suo files, and I haven't seen any since VS2012, so I figured they were replaced with something else. What gives?History
As some already stated. This is the magic wand for many issues. Kudos!Latoya
In addition to deleting the .v12.suo file, after relaunching Visual Studio, I have to cut/save/paste/save the content in the front-end .ascx control. As soon as I do that, IntelliSense works again. I'm using VS 2013.Kantianism
O
68

Resetting my settings or importing previously exported, working settings, and restarting Visual Studio worked: Tools > Import and Export Settings... > Reset all settings.

EDIT: This keeps happening to me, surprisingly often in VS Express, and occasionally in VS Professional. One thing I noticed in Pro, is that it has happened after unexpected shut downs (when IT forces a reboot in the middle of the night). So it may be related to Visual Studio not closing correctly. The technique described above has worked every time.

Oresund answered 15/4, 2014 at 15:6 Comment(8)
Thanks, today, I had the Intellisense problem again and your solution solved the problem.Claudication
Thanks, this worked for me too. If you read to the bottom try this before you remove all your extensions.Involutional
:D I actually removed all my extensions first. Anyway, it worked!Spiritual
this fixed my issue as wellProvitamin
This was the best option. Excellent.Armourer
Had the issue after installing .net 4.6 targeting pack. This resolved it.Outwork
This solved my issue after I installed VS2013 (coming from 2010)Mariehamn
Unexpected shutdowns can corrupt *.sdf SQL Server Compact database. There's a hotfix for that: support.microsoft.com/en-us/kb/2960153Carolyn
D
35

Tools > Options > Text Editor > C# > General

Make sure that "Auto List Members" is checked

Desperation answered 11/12, 2014 at 18:14 Comment(2)
This worked for me. Deleting the .suo file has worked on many occasions before, but this time it did not.Butts
This worked for me. Visual Studio 2013. IT switched us to a new domain and lost all VS settings.Boarer
C
26

I have found one way to solve the problem. That is, 1. -> Remove the ASP.NET MVC Project from Solution, 2. -> Then, add the MVC Project back to the Solution.

By doing these steps, I can get the Intellisense again. But, I am not happy with this solution though, because, next time when I double click the Solution file to open the solution, I see the intellisense is not working again. I would like to know the real reason why it is behaving like that.

EDIT:

Finally, I figured out that it was a 3rd party visual studio extension which was causing the problem. In order to find out that extension, I removed all extensions and then, added the extensions one by one and stopped where I found the culprit extension that was taking my sleep away :).

Claudication answered 1/2, 2014 at 2:32 Comment(8)
Been dealing with this for a month and it's driving me crazy. Removing and readding from the solution (although a pain) did work for me too. Thanks!Gabel
Which extension was to blame?Weiland
In my case, it was Xamarin extension, but I do not want to say bad about Xamarin, because, their customer support is super excellent. As soon as I reported the problem, they provided me the fixed version quickly. Moreover, the most recent version of Xamarin extension does not seem to have that problem anymore. My point is, any extension's specific version can cause such problem, we may need to uninstall the extensions one by one to find out which is causing the problem. For example, a future version of today's good extension can cause such problem too. We need to watch out in that case.Claudication
Unloading the project and reloading it worked for me too thankyou!Breskin
You should also try this if you got at this point and nothing works: https://mcmap.net/q/172489/-visual-studio-2013-intellisense-stops-working-for-asp-net-mvc5-controllersGiorgio
That's for this, it really helped me out. It's still a pain, but it's much less a pain then closing out VS completely. I run a plain version with only 1 added extention which is AnkhSVN, that I can't remove.Hexagonal
In my case it was the Xamarin extension. Uninstalled it and the problem went away. This was the latest version too!Stock
I had the same issue with the Xamarin extension, but for some reason only with one particular project. It was an expired trial so I just uninstalled it and syntax highlighting came back.Paleography
B
8

You can unload project and reload the MVC project from solution

  1. Right Click on MVC project in solution explorer -> "Unload Project"
  2. Right Click on MVC project in solution explorer -> "Reload Project"

After this the Intellesense rework quickly.

Bysshe answered 13/5, 2015 at 8:3 Comment(1)
T
6
  • Tools -> Options
  • Text Editor -> C# -> Intellisense
  • Ensure "Show completion list after a character is typed" is checked

VS2013 intellisense code completion

Trahan answered 28/9, 2014 at 23:58 Comment(2)
This worked for me. I'm not sure if the install defaulted these to be unchecked, but the following were unchecked for me and this was a fresh install. "Auto list members" "Parameter information". I was not getting the intellisense on method parameters either. The only plugin I have is GhostDocLithography
@Lithography Thank you! This was the correct answer for me with VS2013.Supercharger
A
5

I'm not sure why it occurs, but when it happens to me I can recover Intellisense by simply restarting Visual Studio.

You're right, it's really annoying.

Argueta answered 2/2, 2014 at 5:25 Comment(0)
M
4

Sometimes RESET of VS settings can help:

TOOLS->Import and Export Settings Wizard->Reset all settings->checkbox "No, just reset settings, overwriting my current settings"->Next>Next>Next

I had messed them with RESHARPER, and this helped.

Mucosa answered 27/1, 2015 at 11:48 Comment(3)
well, it WAS like that for me, sorry. I had messed them with RESHARPER's settings.Mucosa
Upvoted. Resharper has played havoc with my settings in the past.Chervonets
This is acceptable only for someone who hasn't customized anything.Crowther
H
3

I found that the best way to fix IntelliSense issues is to simply unload the project in the solution explorer and load the project again. After that IntelliSense is always working for me and I do not loose bookmarks, breakpoints or any other settings.

Hent answered 10/4, 2015 at 7:47 Comment(1)
This is the simplest way. T.Y.Taffeta
A
1

I have found that if the build fails then the Intellisense seems to break. After fixing my build errors and rebuilding the project the Intellisense will work after reloading the particular Razor file.

Apostate answered 24/6, 2014 at 13:35 Comment(0)
H
1

In my case, restart didn't work.

So I did the following weird steps :

  1. Closed the solution
  2. Opened another solution
  3. Verified that intellisense worked in this other solution.
  4. Closed the other solution
  5. Finally, reopened the first solution.

And the intellisense worked again.

Homeric answered 7/7, 2014 at 13:43 Comment(1)
This didn't work, but it was a good troubleshooting step to see if it is the project or visual studio itself that is causing the problem.Ladysmith
H
1

Usually this happens when the buffers have an error in them. Most of the time the local cache error is cleared when you close a, windows form, for example and reopen therefore reloading it into memory. Many of the solutions above work but sometimes it as as simple as closing the item and designer and reopening the item.

Additionally you can try to force a reset by

Ctrl+K, Ctrl+I shows quick info Ctrl+Shift+Space shows you param info

Hundredth answered 26/7, 2014 at 0:27 Comment(0)
B
1

I tried lots of things which didn't work. In the end, I cut code to clipboard, recreated the controller and pasted code in. Problem solved!

Ballroom answered 11/12, 2014 at 14:24 Comment(0)
M
1

I too have the same issue with Intellisense in my Text editor.

i just close example.cs file which is not providing Intellisense and reopen that class without restart Visual Studio it works for me.

Note : i don't have the same issue with all the .CS file in Solution Explorer

Multiplicand answered 17/12, 2014 at 21:0 Comment(0)
M
1

I use VS 2013 and I had the same problem. My solution was update VS to last version. I my case Update 4. Simply reference in project must match with assembly in GAC on computer (OS). Intellisense come from VS not from project.

I hope that will handy for some one.

Messiaen answered 22/4, 2015 at 14:29 Comment(0)
V
1

... Yet another answer - but this was the cause of my pain: I'd installed Developer Assistant which had been working nicely but suddenly stopped providing suggestions. To get it working again:

options -> developer assistant -> Intellisense -> Default Visual Studio Intellisense

Took me 5 hours to find that :(

HTH.

Vassar answered 24/7, 2015 at 18:14 Comment(0)
A
1
Tools->Options->Text Editor->C# (or All Languages)->General

check the check box for enable Auto List Members and Parameter Information in right hand side pane.

If its not selected,select it.

Autopsy answered 5/11, 2015 at 12:9 Comment(0)
G
0

Save everything and restart Visual Studio!

Girt answered 15/4, 2014 at 15:24 Comment(0)
L
0

I get this exact same thing every time I work with one particular MVC5 project. Restarting VS2013 does not work. Deleting suo files does not work. Resetting all tools settings does not work. The only thing that ever works is removing the project from the solution and adding it again. Seeing as I have to do this every day is is really quite annoying. Especially when I have it set to reopen the last files I had open, I then need to track down the ones I was working on and re-open them instead of the popping up automagically..

Lightfooted answered 24/6, 2014 at 11:37 Comment(0)
C
0

I'm using VS 2013 with MVC 5. The solution for me was to add the following to Web.config:

<compilation debug="true" targetFramework="4.5.1">
  <assemblies>
    <add assembly="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Web.Optimization, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  </assemblies>
</compilation>
Cambrian answered 8/9, 2014 at 12:34 Comment(0)
K
0

Rushonerok's solution works great for me.
For anyone who doesn't know: <ProjectName>.v12.suo is a hidden file in project root folder. You must set on "Show hidden files" in your file browser to see it.

Kimberlykimberlyn answered 16/2, 2015 at 11:25 Comment(0)
S
0

So far some these solutions have not worked for me.

I have the following Workaround

Simply declare the type you want to use explicitly in a new variable and use that instead of Model.

@model MyModel
MyModel mymodel = Model;

@mymodel.MyIntelisenseIsWorkingAgain
Slime answered 25/2, 2015 at 20:48 Comment(0)
R
0

To solve this I closed Visual Studio Express 2013 and I reopened the Solution but double clicking on its .sln file directly from the file system. Opening it from the Start Page had my controllers intellisense broken.

Roose answered 29/3, 2015 at 22:2 Comment(0)
F
0

Closing and opening the Visual Studio Solution worked for me.

Fitzpatrick answered 27/11, 2016 at 5:33 Comment(0)
E
0

Sometimes you close it by mistake. Try ctrl+space for windows or cmd+space for mac to turn it on.

Endora answered 29/11, 2017 at 9:6 Comment(0)
B
0

I know I'm a bit late, but adding this to my App.config file did the trick!

<system.web>
    <compilation>
        <assemblies>
            <add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        </assemblies>
    </compilation>
</system.web>
Bergamo answered 26/4, 2019 at 15:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.