Hi,
The error LocalAgentCommon.LocalAgentInvalidOperationException: Unable to cleanup modules in Dynamics 365 Finance and Operations (on-premises) typically occurs during servicing or deployment cleanup operations. This is often related to issues with the Local Agent, Service Fabric, or module dependencies.
LocalAgentCommon.LocalAgentInvalidOperationException: Unable to cleanup modules
Here’s how you can troubleshoot and resolve it:
.\LocalAgentCLI.exe Cleanup "<path to localagent-config.json>"
J:\MonAgentData\SingleAgent\Tables
DeployablePackages
Please verify if this helps resolve the issue or if you'd like assistance with specific commands or log analysis.
Thanks and best regards,\ Daniele\ Note: This response was prepared with support from Copilot to ensure clarity and completeness.
[1]: https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/deployment/troubleshoot-on-prem\ [2]: https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/lifecycle-services/update-local-agent\ [3]: https://stoneridgesoftware.com/how-to-fix-a-binary-deployment-fail-in-dynamics-365-for-finance-operations/
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Mansi Soni as our August 2025 Community…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Mansi Soni 243 Super User 2025 Season 2
Muhammad Shahzad Sh... 158 Most Valuable Professional
Abhilash Warrier 95 Super User 2025 Season 2