Skip to main content

Getting Error on AIF Web service enabling for custom class in Ax 2012

Problem
I am Getting below Errors on AIF Web service enabling for custom class in Ax 2012.

1.Application pool 'MicrosoftDynamicsAXAif60' is being automatically disabled due to a series of failures in the process(es) serving that application pool.


2.
There was an error during processing of the managed application service auto-start for configuration path: 'MACHINE/WEBROOT/APPHOST/Default Web Site/MicrosoftDynamicsAXAif60'. The error message returned is: 'An initialization error occurred while trying to preload an application.

Exception: System.Configuration.ConfigurationErrorsException

Message: Duplicate type with name 'Dynamics.Ax.Application.NewItem' in assembly 'Dynamics.Ax.Application, Version=6.3.1000.309, Culture=neutral, PublicKeyToken=null'.

StackTrace:    at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)
   at System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()
   at System.Web.Configuration.AssemblyInfo.get_AssemblyInternal()
   at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)
   at System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded)
   at System.Web.Compilation.BuildManager.ExecutePreAppStart()
   at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)

InnerException: System.BadImageFormatException

Message: Duplicate type with name 'Dynamics.Ax.Application.NewItem' in assembly 'Dynamics.Ax.Application, Version=6.3.1000.309, Culture=neutral, PublicKeyToken=null'.

StackTrace:    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)'.  The worker process will be marked unhealthy and be shutdown.  The data field contains the error code.


Solution:After struggling a lot I found solution for this which I am sharing here to help you and save your time.

Following steps I did to resolve this issues.

1.Stop AOS, 
2.Truncate table SYSXPPAssembly, 
3.delete folder xppil form Bin folder
C:\Program Files\Microsoft Dynamics AX\60\Server\AX_60_Dynamics_TEST\Bin\
4.Run AOS services, 
5.Axbuild, and full compile full cil
6.the problem cause the dll and net module not refresh delete all file in C:\Program Files\Microsoft Dynamics AX\60\AifWebServices\Bin
7.Enable customized port in ax again 
Now problem resolved enjoy and happy daxing.

Popular posts from this blog

How to set up parent project in project accounting in ax 2012

create simple project and then go to the project hierarchy fast tab and there you must define sub-project ID format "-#" and then your sub-project will be enabled. For resource assigning in Project first you need to configure the HR module, in that you need to maintain the calendar for those employees and then you need to define the cost of that particular employee (for expense) and for Revenue you need to define the sales price of that particular employee. In the project accounting module you need to mention the calendar in scheduling fast tab and then you need to define WBS, in WBS activity you can be able to assign resources.

ERD Account Payable and Account Receivable in ax 2012