Visual Studio 2017 does not highlight errors

I recently upgraded from Visual Studio 2012 to 2017 (upgraded to version 15.3.5) and you have some problems with the IDE.

In a specific project, I do not receive an error message.

enter image description here

and on the Error List pane, Build Only actually displays more information than Build + IntelliSense

enter image description here

In addition, when selecting "Build + IntelliSense" I can see a compiler error in the "Output" window. Here is a list of errors after a failed build

enter image description here

but the output window has the following:

3> ------ Build started: Project: ..., Configuration: Debug Any processor ------
3> C: \ Checkout ... \ MainForm.vb (454.27): error BC30311: A value of type 'Module1.aClass' cannot be converted to 'Module1.bClass'.

This does not happen in all projects. I did a new project to see if I can reproduce, and I cannot. Here is a new project with the same code where the error is underlined in the code and "Build + IntelliSense" works.

enter image description here

I even sorted the xml in the vbproj files and β€œscattered” the insult project against the new project, and there is no obvious difference that could cause this. Both refer to the same compiler. Both projects target .Net 4.6.2 and are installed for compilation for x86 only. The abusive project refers to several other projects (C # and VB.Net), as well as a third-party dll and the nuget package. Apart from these differences, there is nothing else.

Other projects (C # and VB.Net) work fine in solving an abusive project.

I saw that similar issues were discussed on the Internet, but no fixes worked for me. I tried the Repair option in the installer. Then I uninstalled Visual Studio and reinstalled.

Update:

Changing the target structure seems to have some effect. A project with this behavior targeted 4.6.2 and showed no errors, and when it was changed to 4.7, it found a compilation error. Then, returning to 4.5, she showed an error. Then, returning to 4.6.2, he found no errors. The repetition of this process turned out to be unique. 4.7, 4.5, 4.6, 4.6.2 - everything, now everyone does not show errors.

It is also important to link this Microsoft page https://developercommunity.visualstudio.com/content/problem/7759/no-errors-displayed-in-the-error-list.html as many other people have a similar problem.

+3
source share
1 answer

I solved the problem, at least in my solution.

I played with links to projects and found that when a particular project did not refer to another project, I received an error message. I went through the process of changing the goals of the framework version until something worked.

All of my projects have previously targeted .NET 4.6.2. Directing 4.7 to all projects, now I get the correct error, underlining and reporting errors in the window.

I'm not sure if this is a solution for everyone, and I will need additional work to deploy my project, but I can accept it.

I assume this is due to targeting 4.6.2 using Visual Studio 2012 and upgrading to 2017. Perhaps something was not installed properly if / when the projects were updated.

+1
source

Source: https://habr.com/ru/post/1271094/


All Articles