最近、Visual Studio 2012から2017(バージョン15.3.5に更新)にアップグレードしましたが、IDEに問題があります。
特定のプロジェクトでは、アンダースコアのエラーが発生しません。
エラーリストペインでは、「ビルドのみ」には実際には「ビルド+ IntelliSense」よりも多くの情報が表示されます。
また、「ビルド+ IntelliSense」を選択すると、出力ウィンドウにコンパイラエラーしか表示されません。ビルドが失敗した後のエラーリストは次のとおりです
しかし、出力ウィンドウには次のものがあります。
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.
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.
I have solved the problem, at least in my solution.
プロジェクト参照をいじっていたところ、特定のプロジェクトが別のプロジェクトによって参照されていない場合、下線が間違っていることがわかりました。何かがうまくいくまで、フレームワークのバージョンターゲットを変更するプロセスを経ました。
私のプロジェクトはすべて、以前は.NET4.6.2を対象としていました。すべてのプロジェクトで4.7をターゲットにすることで、エラーウィンドウに適切なエラーアンダースコアとレポートが表示されるようになりました。
これがすべての人にとっての解決策であるかどうかはわかりません。プロジェクトを本番環境にデプロイするには、私の側で追加の作業が必要になりますが、これは受け入れることができます。
これは、Visual Studio 2012を使用して4.6.2をターゲットにし、2017にアップグレードすることに関連していると思います。プロジェクトがアップグレードされた場合、何かが正しく設定されなかった可能性があります。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加