I'm currently developing a fairly large extension for Microsoft Dynamics 365 Business Central. The project includes various components such as:
- Reports (RDLC, Excel, Word)
- Report layouts
- Codeunits
- Page modifications
- And other AL objects
The extension builds successfully without any compilation errors.
However, I'm intermittently encountering an issue when publishing the extension to a Business Central Sandbox (cloud environment). The publishing process sometimes fails with the following error:
[2025-06-05 11:17:14.17] Publishing AL application using launch configuration 'Microsoft cloud sandbox'.
[2025-06-05 11:17:15.36] Authenticated as user '' in tenant ''.
[2025-06-05 11:17:15.36] Targeting Dynamics 365 Business Central.
[2025-06-05 11:17:15.36] Sending request to https://api.businesscentral.dynamics.com/v2.0/Sandbox-Dev/dev/apps?SchemaUpdateMode=synchronize&DependencyPublishingOption=default
[2025-06-05 11:17:45.50] Error: An error occurred while processing the request.
Request ID:
Session ID:
[2025-06-05 11:17:45.52] The request for path /v2.0/Sandbox-Dev/dev/apps... failed with code UnprocessableEntity.
Reason: Publishing failed due to 'Object reference not set to an instance of an object.' The original extensions could not be restored due to the same error.
Extensions that were previously installed but could not be reinstalled. These should be manually reinstalled. If they are part of your current workspace, you can use the 'Full Dependency Publishing' command.
Temporary Workaround
Restarting the affected environment from the Business Central Admin Center allows me to successfully re-publish the extension afterward.
This issue is not tenant-specific—I experience the same behavior on other tenants as well. After some time, publishing fails with the same error, and restarting the environment resolves it temporarily.
Request for Guidance
Are there recommended steps I can take to further analyze:
- Whether this is a code-level issue in the extension?
- Or whether the problem lies within the target environment(s)?
Any insights, tools, or debugging techniques to help pinpoint the root cause would be greatly appreciated.
Thank you in advance!
Additional Image for Reference (Ignore the 327 problems, they're not substantial as they did not block extension building/pushing previously ):
