Business Central Error

We are trying to deploy a mega app to Business Central 16 (spring 2020) and get an ‘Object reference not set to an instance of an object’ in Microsoft.Dynamics.Nav.Management.dll.

With some help of the mibuso forum and the poster of the original problem there, we have found the error and could solve it.

Finding the root problem involves installing visual studio (enterprise in our case) on the business central server, attaching to the Nav server.exe process for debugging and deploying when de debugger is attached.

You will get into the debugger at the moment of the error in the deployment. We’ve got a neat error on the callstack, pointing out the object which is being processed at the time of the error, and the statement which is causing the problem. Not why it’s a problem, but you get some idea.
In our case it seams to be the use of a global Boolean called Update which is initialized to True in the OnPageOpen of the requestpage of the report.
Removing this initialization on that particular place in code resolves the issue.