11 April 2022

D365FO: Visual Studio 2019 crashes

If you tried to develop or debug D365FO customizations using Visual Studio 2019, you probably noticed how often it crashes or shows various errors.

Peter Villadsen, Principal Program Manager from Microsoft, highlighted possible root cause of the problems in his latest post and also provided few workarounds. According to Peter, Visual Studio 2019 is still 32-bit process and suffers from memory limitations while loading lots of PDB files during debugging. One of the options is to enable "Load symbols only for items in the solution" options in "Dynamics 365" debugging settings and manually load required PDB files when needed.

These workarounds are working for small ISV solutions, when you have little number of files per model. In this case you could indeed enable "Load symbols only for items in the solution" options in "Dynamics 365" debugging settings. For the large solutions, however, it does not really work. You will still have objects, which are not in your solution, thus manual PDB loading will be required.

From my experience, the best way to debug D365FO customizations using Visual Studio 2019 is to keep "Load symbols only for items in the solution" option enabled as long as possible and keep an eye on Visual Studio 2019 memory consumption in Windows Task Manager. Disable "Load symbols only for items in the solution" option only when needed to debug Microsoft's code or when you can't add all required objects to your solution (for example, if you have multiple models or too many files). Once Visual Studio 2019 will consume more than 8GB RAM, it will surely crash. Just restart Visual Studio before it crashes and continue your work.

No comments:

Post a Comment