Recently I came across an error while doing a complete build on D365
Error :
Severity Code Description Project File Line Suppression StateSeverity Code Description Project File Line Suppression StateError System.InvalidOperationException: Unable to recycle AppPool ‘AOSService’ running Site ‘AOSService’. Check your IIS/Azure Environment for correct deployment. —> System.Runtime.InteropServices.COMException: The object identifier does not represent a valid object. (Exception from HRESULT: 0x800710D8) at Microsoft.Web.Administration.Interop.IAppHostMethodInstance.Execute() at Microsoft.Web.Administration.ConfigurationElement.ExecuteMethod(String methodName) at Microsoft.Web.Administration.ApplicationPool.Recycle() at Microsoft.Dynamics.Framework.Tools.AosAppPoolRecycler.RecycleAppPool() — End of inner exception stack trace — at Microsoft.Dynamics.Framework.Tools.AosAppPoolRecycler.RecycleAppPool() at Microsoft.Dynamics.Framework.Tools.BuildTasks.SyncEngineWrapper.Sync(CancellationToken cancellationToken) 0
Solution:
To verify that an application pool has recycled correctly, follow these steps:
Open Internet Information Services (IIS) Manager as an administrator.
In Connections pane, expand your computer name.
Open Application Pools
Find the AOSService pool and if it is stopped, start it.