I am using Visual Studio 2010 (c++), and Intellisense has stopped working. I've read that an error in the code can cause this, but my code compiles fine, I only have some warnings about a deprecated function, can this cause intellisense to stop working?
I tried deleting the .ncb file, but is not being regenerated. Also I read here that I have to make sure that stdafx.h is on the include path but I dont have stdafx.h on my project and I have used intellisense without it in the past.
I don't know what else I can do to try to make it work, any suggestions?
The IntelliSense parser was completely rewritten for VS2010. It no longer uses the .ncb file, it is now an .sdf file, a SQL Compact database. If you program in the C++/CLI language then you'll get no IntelliSense at all, the current implementation doesn't support that language. I've also seen feedback that C isn't well supported either yet.
Related
This is a new one for me. I have been asked, for legal reasons, to setup a laptop with Visual Studio, but to disable the ability to compile projects/solutions. The purpose is to enable browsing of the source code, but not allow building or executing it.
Yes, I know this is really a stupid question and unfortunately I can't get into too many details. I've asked about using alternative text editors, but I have been told no. So until I can prove it isn't possible (or that I have at least made a reasonable effort), I have to try and make this work. Notepad++ would be an excellent alternative, but that has been rejected.
This would be in Visual Studio 2010 or later. Is there any way that I can do this?
UPDATE
After trying Marius Bancila's suggestion of removing the compilers and MSBuild, I was surprised to find out that VS continued to work fine (except for building, of course). I did not expect that functionality like F12 (Go To Definition) would continue to work.
This may mean that there still remains the ability to build something somewhere somehow. But as it stands with MSBuild permanently deleted and the Visual Studio Build command not working, it'll take some effort to get around it (if a way in fact does exist).
You didn't say what projects should not be possible to build (VC++, VC#, VB.NET, F#, etc.). Starting with VS2010 they are all built using MSBuild. So if you delete MSBuild they will not be able to build from inside Visual Studio. However, one can still be able to build from the command line, so the only possibility I see is that you delete all the compilers that come with Visual Studio.
It's a little bit crazy, but if you really have to ...
Try deleting some important binaries after installing Visual Studio e.g. linker (link.exe) and compiler (cl.exe).
Use a text editor instead. Notepad++ even comes with color syntax highlighting.
You cannot prevent people from compiling the code. Visual Studio Express is available to anyone, and the compiler can be executed from the command line, without Visual Studio's help.
In various code files of various projects, Visual Studio sometimes gives an error message when I tell it to remove and sort the usings of the code file. The message:
"Your project or one of its references does not currently build. If you
continue with this operation, required usings may be removed."
However, this is not true. Required usings are not removed when telling VS to continue, and the project does build.
I have Googled this issue, looked in MSDN, and tried to figure out why I get this on certain code files but not others, but no no avail.
Has anyone else encountered this, and if so, any ideas what this is about?
Ps. I am running VS 2012 Ultimate, but I saw this from at least 2005.
This error message can come up erroneously, and is a known issue documented out on Microsoft Connect:
http://connect.microsoft.com/VisualStudio/feedback/details/785457/remove-unused-usings-falsely-reports-that-project-does-not-build-for-certain-files
It will not be fixed with the current MSBuild compiler, but will be fixed with Roslyn.
Workaround:
You can disable the warning message by going to Tools->Options->Text
Editor->C#->Advanced->"Warn if build errors exist when organizing
usings".
Keep in mind this has the downside that it won't protect you any more
if your solution really does not build.
I had this same issue and it turned out there was an invalidly formatted class reference in an XML comment. I had something like this
<see cref="List{T">
Note the missing '}' character at the end. It was driving me crazy until I found that.
Note: I'm using Visual Studio 2012 with the Productivity Power Tools installed, and this was happening every time I saved because I had the "remove and sort usings on save" option turned on. I really like this feature and was on the point of turning it off due to these warnings, thinking it was buggy. Now I know what to look for when I get them.
I am working on a big solution that contains a mix of C# and C++ code using Visual Studio 2012 Professional with the latest Resharper plugin.
I obtain a fresh copy of the entire solution from source control.
As expected, Intellisense places its curly red lines under many types and fields in C++ code before I compile my Solution for the first time. However now these squiggly lines do not disappear even after (successfully) compiling the entire solution.
I get 100+ Intellisense errors saying "Intellisense: cannot open source file .tlh
But these files definitely exist at the given location and VS has full access rights to them as I start it with elevated rights..
I am even able to jump into the namespaces, declarations or whatever with the red lines underneath so the code definitely exists.
How do I make Intellisense worke again and make these annoying lines disappear?
In Visual Studio 2005, I have a .h file with preprocessor macros in it. They are apparently too complicated for Visual Studio's Intellisense because they make Visual Studio crash if they are present whereas it works fine if they are not. Does anyone know of a way to prevent Visual Studio parsing the file for Intellisense but still include it in the build. By the way, I have already tried the following:
Disabling Intellisense by renaming feacp.dll. Works, but impractical.
Visual Assist. Works, but $250.
Installing Visual Studio SP1 + the Intellisense hotfix (KB947315). Doesn't fix it (and ate 1GB of hard drive space).
The first thing to try is to install Visual Studio 2005 SP1. This fixes a lot of intellisense related issues which may help you out
http://msdn.microsoft.com/en-us/vstudio/bb265237.aspx
If that doesn't fix the problem try excluding the file from the project. This prevents it any any of it's contents from appearing in Visual Studio features (such as intellisense). If it's just a header file it shouldn't impact the build as the actual file won't be removed, it just won't be considered part of the project.
Ok, for the benefit of others, I'm going to solve this myself! I've been fiddling and the answer is as follows. If you have this problem, and you delete your ncb file to force Intellisense to update, you can prove to yourself that this works.
#ifdef out the offending code in your .h file as follows:
#ifdef SOMETHING_UNIQUE
<the offending code>
#endif
in the file that actually uses the macros (the cpp file that #includes the .h file):
#define SOMETHING_UNIQUE
Intellisense will now ignore the code in the .h file that causes it to crash (it will be greyed out in the editor), but it still gets compiled.
Today my Visual studio couldn't help me by auto complete so I thought that the ReSharper trial period had ended .After I suspended ReSharper I see that still no auto complete. After a few changes I see still the same problem and there are some strange behavior in Visual Studio. For example I see m_value field for int. But my other Visual studio instances works as expected. How can I fix this problem?
Probably there is an error somewhere in your code which is causing the types to be determined incorrectly - for example a missing curly brace. Check your code carefully for errors. Make sure that your code compiles correctly.
PS: You don't need ReSharper to get autocompletion. Intellisense is a standard feature of Visual Studio. Even without ReSharper I find the built-in autocompletion extremely usable.
IntelliSense is Microsoft's implementation of autocompletion, best known for its use in the Microsoft Visual Studio integrated development environment.
The file property build action was content and this was reason of those strange behaviours. It is fixed after turned build action to compile.