6
votes

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

In a certain project, I don't get error underlining.

enter image description here

and in the Error List pane, "Build Only" actually shows more information than "Build + IntelliSense"

enter image description here

Also, with "Build + IntelliSense" selected, I can only see the compiler error in the Output window. Here is the error list after a failed build

enter image description here

but the output window has this:

3>------ Build started: Project: ..., Configuration: Debug Any CPU ------
3>C:\Checkout...\MainForm.vb(454,27): error BC30311: Value of type 'Module1.aClass' cannot be converted to 'Module1.bClass'.

This doesn't happen on all projects. I made a new project to see if I could reproduce, and I can't. Here is a new project with the same code, where the error is underlined in code and "Build + IntelliSense" works.

enter image description here

I have even sorted the xml in the vbproj files and "diffed" the offending project vs the new project, and there is no obvious difference which would cause this. Both reference the same compiler. Both projects target .Net 4.6.2 and are set to compile for x86 only. The offending project references a few other projects (C# and VB.Net) plus a third party dll and a nuget package. Aside from these differences there is nothing else.

Other projects (C# and VB.Net) in the offending project's solution work fine.

I have seen similar issues talked about online but no fixes have worked for me. I have tried the "Repair" option in the installer. I then uninstalled Visual Studio and reinstalled.

Update:

Changing the target framework seems to have some effect. A project with this behavior was targeting 4.6.2 and showing no errors, and when it was changed to 4.7, it showed a compile error. Then changing back to 4.5 it showed an error. Then changing back to 4.6.2 it showed no errors. Repeating the process proved to be non repeatable. 4.7, 4.5, 4.6, 4.6.2 - whatever, now all show no errors.

It's 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 seem to have a similar issue.

1
Very odd behaviour... Seems like a bug to me. Have you tried the problematic project on another computer with the same VS version? -- If I were you I'd write a bug report to Microsoft, attaching the project to it. - Visual Vincent
I have created a new project with your code in Visual Studio 2012, then update it with Visual Studio 2017, could not reproduce this issue. So this issue seems more related to your project, how about create a new project with above code in your solution, check if it works fine? Try to delete the .vs file. - Leo Liu-MSFT
No repro, but I've avoided installing the updates. The 15.3.x updates in particular have generated a lot of bug reports, too many for me to risk it. Sometimes we just have to do our job instead of testing Microsoft products. Using Help > Send Feedback > Report a Problem is the proper avenue to report these kind of problems. - Hans Passant
@Leo-MSFT the project was originally a sample project from a third party which had <ProductVersion>9.0.30729</ProductVersion> in the project file (Visual Studio 2008?), which was upgraded to 2012, then to 2017. - djv
@HansPassant the issue was present on 15.0 originally, and though I checked the change log before updating to 15.3 and there was no mention of a fix for this, I figured I'd try it out. - djv

1 Answers

4
votes

I have solved the problem, at least in my solution.

I was playing around with project references, and found that when a particular project was not referenced by another project, I got error underlining. I went through a process of changing framework version targets until something worked.

All my projects had previously been targeting .NET 4.6.2. By targeting 4.7 on all the projects, I now get proper error underlining and reporting in the Error window.

I'm not sure if this is a solution for everyone and it will take some additional work on my end to deploy my project to production but I can accept this.

I guess this is related to targeting 4.6.2 using Visual Studio 2012 and upgrading to 2017. Maybe something was not set properly if/when the projects were upgraded.