7

Since Visual Studio 2017 version 15.8 we have on some computers in my team the following really weird build error.

enter image description here

Additionally Visual Studio recognizes it

enter image description here

but the IDE itself doesn't crash.

To check if it only happens to our own solutions I created a new simple, plain command line tool project which shows the same build behavior. So it isn't exclusive to our solutions.

I tried to get help from Microsoft but it seems they don't know what to do about it. The thread doesn't show all the material I provided to them. They got a lot of logs and a sample project from me. A crash dump wasn't possible to provide, because Visual Studio itself doesn't crash.

Repair and full uninstall, new install of Visual Studio didn't help either.

Edit: It is not only occurring on my development machine but on our build servers (there are two of them), too. Interestingly our VMs on the development machines does not seem to have this issue.

Bharata
  • 13,509
  • 6
  • 36
  • 50
Mil
  • 756
  • 2
  • 11
  • 30

4 Answers4

0

Unfortunately in this case you have only three two options:

  1. You could try to describe all the steps to reproduce this crash so much detailed as you could with a lot of screenshot images from this steps. Use for this DOC file format, PDF or some like that. This file you have to send to Visual Studio support.
  2. You could try to create the crash dump. Each time Visual Studio crashes, it will create a dump file devenv.exe.[number].dmp file in the configured location. Each dump file produced by this method will be up to 4 GB. in size. Make sure to set DumpFolder to a location with adequate drive space or adjust the DumpCount appropriately. I know, you wrote already on MS forum that this error doesn't create one dump. But would you like to imagine that you have 10 crashes on a day and on each crash one dump file in size 4 GB. will be written? The dump creating is disabled normaly and you have to enable it. How to enable it you could find using search string in Google: "How to enable dump files in Windows" or for Windows 10 you could see this video. Alternatively or additionally you could use the programm tool "ADPlus" for creating memory dump files and log files with debug output from one or more processes. This tool is very detailed describen on this MS Support page.
  3. You could try to debug by yourself. But in the case if you want do it you have to see "Tools listing Included in Debugging Tools for Windows".

Normaly by Visual Studio support do not work the Visual Studio developers. You have to be nice to them and they do what they can do. You could not expect from them that they all know. They do their job using some given instructions.

In your case the support worker has gived you the link Reporting Visual Studio crashes and performance issues in which you have to read the following part:

Directly reproducible crashes

Directly reproducible crashes are cases which have all of the following characteristics:

  1. Can be observed by following a known set of steps
  2. Can be observed on multiple computers (if available)
  3. If the steps involve opening a project or document, can be reproduced in sample code or a project which can be linked to or provided as part of the feedback

For these issues, follow the steps in "How to Report a Problem" and be sure to include:

  • The steps to reproduce the problem
  • A standalone repro project as described above. If this is not possible, then please include:

    • The language of the open projects (C#, C++, etc.)
    • The kind of project (Console Application, ASP.NET, etc.)
    • Any extensions that are installed.

Most valuable feedback: For this case, the most valuable feedback is the set of steps to reproduce the issue along with sample source code.

Unknown crashes

If you're not sure what's causing your crashes or they seem random, then you can capture dumps locally each time Visual Studio crashes and attach those to separate feedback items. To save dumps locally when Visual Studio crashes, set the following registry entries:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\devenv.exe]
"DumpFolder"="C:\\Crashdumps"
"DumpCount"=dword:00000005
"DumpType"=dword:00000002

⚠️ Each dump file produced by this method will be up to 4 GB. in size. Make sure to set DumpFolder to a location with adequate drive space or adjust the DumpCount appropriately.

Each time Visual Studio crashes, it will create a dump file devenv.exe.[number].dmp file in the configured location.

Then, use Visual Studio's "Report a Problem..." feature. It will allow you to attach the appropriate dump.

  1. Locate the dump file for the crash you are reporting (look for a file with the correct Creation time)
  2. If possible, zip the file (*.zip) to reduce its size before submitting feedback
  3. Follow the steps in "How to Report a Problem", and attach the heap dump to a new feedback item.

⚠️ Do not attach heap dumps to existing feedback items. Please create a new feedback item for each heap dump you would like to submit. If you were requested to provide a heap dump in order to resolve a previous feedback item, simply reply to the request with a link to the new feedback item where the heap dump is attached.

Most valuable feedback: For this case, the most valuable feedback is the heap dump captured at the time of the crash.

Please read it very carefully and in best case two or even tree times successively.

I hope it will help you and I wish you good luck!

Bharata
  • 13,509
  • 6
  • 36
  • 50
0

To me it seems, the problem has something to do with loading assembly from GAC, so I would suggest to try reinstalling Microsoft.CodeAnalysis assembly and see if it helps.

To Do that:

  1. Install Microsoft.CodeAnalysis package to your project with it's required dependencies, make sure to note down all assemblies being downloaded.
  2. Run Visual Studio Developer Command prompt as an Admin
  3. Uninstall existing assemblies from GAC by using command gacutil /u [name of assembly] (do this for all assemblies from step 1)
  4. Install newly downloaded dll using command gacutil /u [Path to Dll] for all dlls (do this for all assemblies from step 1)
  5. Remove package from your project

I hope this helps!

Dipen Shah
  • 25,562
  • 1
  • 32
  • 58
0

As suggested with Dipen in another answer problem seems to be in Microsoft.CodeAnalysis try reinstalling nuget package for that & re-register in GAC if missing.

If Issue still exists, you can try disabling code analysis on your project like:

  1. In Project in VS 2017, open References & right click on Analyzers and click on Open Active Rule Set like: enter image description here

  2. Uncheck all rules so that no code analysis is done on your project like: enter image description here

3 .Save All files and now try rebuilding & run the project to see if issue is resolved.

Pranav Singh
  • 17,079
  • 30
  • 77
  • 104
0

The issue was an older JustMock version installed. Could only solve it with the help of the Roslyn team.

Mil
  • 756
  • 2
  • 11
  • 30