martes, 15 de febrero de 2011 0:45
I have the ubiquitous "intellisense not working" issue... here's my particular scenario: I have a solution with multiple projects... in one (Class Library) project, intellisense works great. In another (web service), the intellisense does not work. It used to, but is now failing. I googled this and discovered that it's quite a common issue, with all sorts of potential fixes. None seem to work for me:
I've tried <ctrl><alt><space> ....... I've dried devenv /ResetSettings ....... I've tried excluding/including web/config ....... I've tried removing the .suo file ....... I've tried looking for an ncb file.
None of these work. What's disturbing is that in the same Visual Studio session, in the same solution, I can flip up to the other project, and in there, Intellisense works great. In fact, in my editor MDI, I can have the code from one project in one tab with Intellisense working, and the code from the other project in another tab, not working. Go figure!
This suggests a project-related issue, but I'm at a loss to find it. Aside: the entire codebase compiles cleanly without even any warnings, so that should have nothing to do with it.
Any pointers would be appreciated.
- Editado JohnJPS martes, 15 de febrero de 2011 15:29 typos
Todas las respuestas
miércoles, 16 de febrero de 2011 15:05Moderador
IS is context sensitive. The fact that it works in one project and not another only tells us that IS is working and is not completely broken. When IS needs information it requests that information from the language service associated with the currently open document. It is up to the LS to give IS the information to display.
The .ncb file is the legacy IS file. For managed projects you won't have one nor will you have one under VS2010 since IS moved to a database format. The .suo file has nothing to do with IS nor will /ResetSettings help you.
The problem resides in your web service project itself. Do you get any IS at all? Meaning if you add a new code file and start typing do you get any IS information at all. At a minimum it should start throwing keywords at you.
If you get basic IS support then the problem resides in the references you're using. If only the system types appear and none of your custom types then it is probably a bad reference. If not even the system types show up then it is something more complicated. Is this a new project or one that was upgraded from VS 2008?
Michael Taylor - 2/16/2011
- Propuesto como respuesta Paul ZhouModerator jueves, 17 de febrero de 2011 9:38
jueves, 17 de febrero de 2011 18:18
Figured it out. In this particular case, we upgraded from VS2008 using CVS behind the scenes to VS2010 using TFS... we also migrated from "web site" to "web app" for project types. During the change from "web site" to "web app," our code files all got marked as "content" rather than actual code. This means they were ignored by the compiler, including no intellisense or "go to definitions", etc.
Long story short... if you're having the intellisense issue, another thing to check is the "Build Action" for your code file... just look at the file's properties and make sure the "Build Action" property is set to "Compile". Voila - everything comes back.
- Marcado como respuesta JohnJPS jueves, 17 de febrero de 2011 18:18
jueves, 24 de febrero de 2011 17:15
Great, that worked a treat for me. No idea how it got changed to "Content", but changing back to "Compile" did the trick. Thanks.
sábado, 28 de enero de 2012 9:38
Found your post after experiencing the same problem, but when I set it to Compile, I get an error about a duplicate reference :
ERROR The namespace '<global namespace>' already contains a definition XXXX
where XXXX is the name of the WebService, but for the life of me I cannot find the duplicate (the "find all references" only returns one hit), and I cannot change the name of the webservice without breaking it.
So I had to set the code behind file back to Content so I could at least get it to compile.
sábado, 28 de enero de 2012 14:55Moderador
This is a compilation error related to your references and not an IDE issue. Please post your question in the C# General forum.
Michael Taylor - 1/28/2012
viernes, 02 de marzo de 2012 9:58
I had the same problem, I tried different methods suggested in different discussion forms, but none worked fine in my case. But in between I found the intellisense is not working for a single solution and finally found the compilation error makes the intellisense not working. So in order to reach your problem you may have go through these steps
- Compile the entire solution and correct the compilation error. If it is not working do the following steps too
- devenv.exe /ResetSettings
- devenv /resetuserdata
- Goto settings and check the following setting are there
miércoles, 05 de septiembre de 2012 23:10
I have this same problem (Intellisense doesn't work and Go To Definition doesn't work).
However, you can't just change the web service build action from Content to Compile ... it will break the projects ability to compile/build correctly.
My work around is to simply just edit any line in the Web Service, even just putting in a blank space or carriage return will fix the problem (*.svc.vb).
This IS an IDE bug and I suspect it might be specific to TFS.
- Editado Robin Ainscough miércoles, 05 de septiembre de 2012 23:14
jueves, 06 de septiembre de 2012 1:20Moderador
Robin your question is off topic for this forum. Your question is related to VB which is an entirely different language written by an entirely different team. The fact that it shows up in the same IDE isn't relevant. The IDE just hosts the languages and their providers. Please post your question in the VB IDE forums.
viernes, 07 de septiembre de 2012 20:47
I think the relevance is that the exact same IDE bug is present for both VB and C# ... so yes I think this is the correct thread to post on.
Agree that parser will operate differently based on the syntax (aka language), but given that it's broken for both C# and VB it would appear to me a common shared element is responsible for this bug. Separating out this response/post to some other forum will only take away useful information regarding the problem. Unless of course Microsoft engineers don't do any code re-use and sharing across parsers ... but wouldn't that be funny if that were the case ;)