Error Importing XPO: There is already a table, an extended data type or a class with name..

Background: We required import an xpo file with a table to AX environment, this table came from an environment that works correctly when we tried to import the file two times an error message appeared “There is already a table, an extended data type or a class with name GsCertificadoCalidadExterno. The import table has been cancelled”.

When we compiled the CIL, It didn’t finish successfully due to this, the system didn’t work correctly, it appeared the next error “AIF Service Section is not activated. Service Section: CuesServiceGroup. Error: Duplicate type with name ‘Dynamics.Ax.Application.GsCertificadoCalidadExterno’ in assembly ‘Dynamics.Ax.Application, Version=6.0.947.280, Culture=neutral, PublicKeyToken=null’” as consequence of this, the AX modules are not working correctly, for example, “All Customers” Form doesn’t show anything, the grid is empty but if we select one row, the customer form appears with the info from customer selected.

In event viewer, we are getting the following error message.
Object Server 03: System.OperationCanceledException: Sección de servicios de AIF no activado. Sección de servicios: CuesServiceGroup. Error: Duplicate type with name ‘Dynamics.Ax.Application.GsCertificadoCalidadExterno’ in assembly ‘Dynamics.Ax.Application, Version=6.0.947.280, Culture=neutral, PublicKeyToken=null’. —> System.BadImageFormatException: Duplicate type with name ‘Dynamics.Ax.Application.GsCertificadoCalidadExterno’ in assembly ‘Dynamics.Ax.Application, Version=6.0.947.280, Culture=neutral, PublicKeyToken=null’.
at System.Signature.GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
at System.Reflection.RtFieldInfo.get_FieldType()
at System.ServiceModel.Description.TypeLoader.CreateTypedMessageDescription(Type typedMessageType, ICustomAttributeProvider returnAttrProvider, XmlName returnValueName, String defaultNS, String action, MessageDirection direction)
at System.ServiceModel.Description.TypeLoader.CreateMessageDescription(MethodInfo methodInfo, Boolean isAsync, XmlName returnValueName, String defaultNS, String action, XmlName wrapperName, String wrapperNamespace, MessageDirection direction)
at System.ServiceModel.Description.TypeLoader.CreateOperationDescription(ContractDescription contractDescription, MethodInfo methodInfo, MessageDirection direction, ContractReflectionInfo reflectionInfo, ContractDescription declaringContract)
at System.ServiceModel.Description.TypeLoader.CreateOperationDescriptions(ContractDescription contractDescription, ContractReflectionInfo reflectionInfo, Type contractToGetMethodsFrom, ContractDescription declaringContract, MessageDirection direction)
at System.ServiceModel.Description.TypeLoader.CreateContractDescription(ServiceContractAttribute contractAttr, Type contractType, Type serviceType, ContractReflectionInfo& reflectionInfo, Object serviceImplementation)
at System.ServiceModel.Description.TypeLoader.LoadContractDescriptionHelper(Type contractType, Type serviceType, Object serviceImplementation)
at System.ServiceModel.Description.ContractDescription.GetContract(Type contractType, Type serviceType)
at System.ServiceModel.ServiceHost.CreateDescription(IDictionary2& implementedContracts) at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) at Microsoft.Dynamics.Ax.Services.AxServiceHost..ctor(Type serviceType, String serviceGroupName, String portType, Boolean integrationEnabled, Boolean portDeployedToIIS, Boolean isXppService, ServiceElement serviceElement, Uri[] baseAddresses) at Microsoft.Dynamics.Ax.Services.AifHelper.PublishServices(String serviceGroupName) --- End of inner exception stack trace --- at Microsoft.Dynamics.Ax.Services.AifHelper.PublishServices(String serviceGroupName) at Microsoft.Dynamics.Ax.Services.AifHelper.PublishAllServiceGroups(Dictionary2 faultedServices)

We tried to solve this error with next steps without success:

1.- We follow the next instructions:
http://community.dynamics.com/product/ax/f/33/p/71712/131040.aspx
2.- We deleted GsCertificadoCalidadExterno table and compiled again.

Hi,

we got the problem and one way to solve was to log on windows with administrator user, open an AX session and do the import as usual.

the used user ‘administrator’ has the admin, EP_Admin and EP_Empl security profile

make a try and let me know if your case is the same as our

Regards,

Thomas

Hi Thomas,

The User that we are using has the same security profile that you mentioned and we are still getting the error.

Do you have another idea of what could be the problem?

Thanks for your help!

Hi Manuel,

Importing with admin profile mostly solved our problem but as you, there was times where it didn’t work, so we used 2 solutions:

-the first was to recreate the object in the target environnment (an empty table with no fields, no methods but same name), export a version of your table with no ID value,import this last one and replace the recreated objet, then reexport the exported projet to other environnments to avoid ID differences.

-the second was a kind of magic but can’t fit your case: we use the profile of one of the consultant from the company that has provided us our ERP, this profile has admin profile and nothing particular but importing with it works all the time

The first solution is longer time but should solve your problem.

Regards,

Thomas

Hi Thomas,

It’s a Little bit confusing the solution #1, let me see if I understood:

First In the destination environment I need to create the table that we want to import without fields or methods, and then I am going to export the Table from the origin environment without Id value and import it to the destination environment

Is that all we need to do for the solution #1 or did I miss something?

Thanks for your help!

Manuel

that’s effectively all you need, to finish, export the replaced table with ids into the other environnments to avoid Ids differences between environnments

You create the table without fields and methods to gain time because you replace the table anyway.

this worked for me, let me know if it works for you.

Thomas

Hello Thomas,

In the environment in which we initially had the problem is Ax 2012, and it was solved after we installed the Cumulative Update 3.

But we had the same problem again, but this time in an environment Ax 2009, in this environment we tried your solution of creating the table with no fields, just the table and the import the table with the fields and methods without id and it worked.

Thank you for your help Thomas!