Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellisense not working for unit test project in Visual Studio Professional 2017

I'm working on a Visual Studio solution using Visual Studio Professional 2017, the solution consists of four types of projects:

  • Several C++ projects
  • A C# project
  • Several C++ unit test projects
  • A C# unit test project

IntelliSense seems to be working for all, except for (at least) one of the C++ unit test projects, and it goes even further: for some tests inside that particular C++ unit test project, IntelliSense is working, but for some other, it isn't.

As mentioned in other Stackoverflow posts, I've already removed the *.cache files and there are no *.ncb files (so I can't remove them :-) ).

I also consulted the MSDN website, as proposed by Visual Studio:

Intellisense: 'No additional information available' (See 'Troubleshooting Intellisense in C++ Projects' for further help.)

I typed the mentioned sentence in MSDN search (docs.microsoft.com), and I got 229 results, which looked useless, and I got 0 results while searching for the exact phrase. :-(

Another approach : in my Visual Studio settings, I've maximised the messages, sent to the output window, I've rebuilt the whole solution, and afterwards I looked for the word IntelliSense in the output window. There was nothing. Then I typed something in order to launch IntelliSense, I verified the output window, but nothing was added.

In order to solve this problem, I need detailed information about IntelliSense itself:

  • I believe that IntelliSense is based on some files. Which ones?
  • I also believe that IntelliSense is keeping its own information in memory. Is this correct, is there a way to store this memory mapped information in files? If yes, which ones, and how can I force IntelliSense to refresh its information?
  • Whatever IntelliSense is doing (filling its information in memory, saving it in files, retrieving its information from those files, ...), what can I do in order to log those actions, so that I have an idea what might be going wrong?

In other words, does anybody have background information on the IntelliSense background task, which might explain what's going wrong, and how I can derive (from information in output window or other) what to do?

Thanks in advance

like image 233
Dominique Avatar asked May 02 '18 08:05

Dominique


People also ask

How do I get IntelliSense in Visual Studio 2017?

To enable the new functionality, go into Tools > Options > Text Editors > C# > IntelliSense. Check the last two boxes under Completion for highlighting and filters. Activate IntelliSense Now, switch to the code-behind for the form, pull up IntelliSense for the FlexGrid, and you'll start to see some changes. Entering .

How do I perform a unit test in Visual Studio 2017?

In the new project dialog box, find the unit test project to use. Type test in the search box to find a unit test project template for the test framework you want to use, such as MSTest (C#) or the Native Unit Test project (C++), and select it. Starting in Visual Studio 2017 version 14.8, the .

How do you create an automated unit test in Visual Studio 2017?

To generate unit tests, your types must be public. Open your solution in Visual Studio and then open the class file that has methods you want to test. Right-click on a method and choose Run IntelliTest to generate unit tests for the code in your method. IntelliTest runs your code many times with different inputs.

How do I enable test in Visual Studio?

To enable Live Unit Testing, select Test > Live Unit Testing > Start from the top-level Visual Studio menu.


1 Answers

You can try resetting Visual Studio once

Devenv /ResetSettings

Sometimes Visual Studio has these gnawing bugs that just stresses you out for no reason.

like image 150
Soham Dasgupta Avatar answered Sep 28 '22 14:09

Soham Dasgupta