Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Error when publihsing an extension: failed with code UnprocessableEntity

(1) ShareShare
ReportReport
Posted on by 59
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 ):
  • Suggested answer
    RockwithNav Profile Picture
    6,999 on at
    Error when publihsing an extension: failed with code UnprocessableEntity
    This is one of the error with too many possibilities, have faced this once - 
     
    • Missing Dependencies – Required extensions or objects are not referenced or installed.

    • Permission Issues – User lacks required rights to publish or modify objects.

    • App.json Issues – Missing or incorrect fields like id, name, publisher, or version.

    • Dependencies Mismatch – Incompatible or incorrect versions of required apps.

    • Invalid Object IDs – Reuse or misalignment of object IDs with environment.

    • Tenant or Environment Issues – Wrong tenant, or environment doesn't allow extension deployment.

    • Schema Mismatch – Extension fields or tables conflict with existing database schema.

    • Invalid Data Format – Unsupported or malformed values in records or fields.

    • Extension Dependencies – Missing or improperly referenced packages or symbols.




    •  
     
     
  • Suggested answer
    Sagar Dangar, MCP Profile Picture
    536 on at
    Error when publihsing an extension: failed with code UnprocessableEntity
    Hi,
     
    Please change"SchemaUpdateMode"::ForceSync and try again
  • Suggested answer
    Sohail Ahmed Profile Picture
    2,552 on at
    Error when publihsing an extension: failed with code UnprocessableEntity
    You're encountering a known issue in Business Central SaaS where publishing large or complex extensions intermittently fails with UnprocessableEntity and the vague error:
    "Object reference not set to an instance of an object."
     
    This is usually not caused by your AL code, but rather an internal environment instability in the sandbox or timeout/lock during schema sync.
     
    ✅ Recommended Actions:
     
    1. Use “Full dependency publishing”
    In VS Code → Ctrl+Shift+P → select AL: Publish with Full Dependencies.
    This resolves the "previous extension couldn't be restored" issue in many cases.
     
     
    2. Avoid SchemaUpdateMode=synchronize for complex schema changes
    If your extension includes significant schema changes, use "SchemaUpdateMode": "Recreate" in your launch.json.
    ⚠️ Be cautious — this removes data.
     
     
    3. Clear pending/unpublished apps
    Go to the Admin Center → check if any apps/extensions are stuck in install/uninstall state and remove them manually.
     
     
    4. Keep extension size and dependencies in check
    Very large AL projects (many objects or layouts) may hit service limits. Consider splitting your app into smaller dependent apps if feasible.
     
     
    5. File a support ticket with Microsoft
    Since this affects multiple tenants, report it via Microsoft Support for Partners or contact your CSP/Microsoft Partner if you're not direct.
     
     
     
    ✅ Mark this answer as verified if it helps you.
     
     
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    23,637 Super User 2025 Season 1 on at
    Error when publihsing an extension: failed with code UnprocessableEntity
     
    Try to use "Full Dependency Publishing" from VS Code.
     
    In Command Palette: AL: Publish with Full Dependencies
     
    Best regards,
    Mohamed Amine MAHMOUDI
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 1,452

#2
YUN ZHU Profile Picture

YUN ZHU 1,313 Super User 2025 Season 1

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 1,083 Most Valuable Professional

Featured topics

Product updates

Dynamics 365 release plans