Greetings!
When I'm trying to use Microsoft.Dynamics.Ax.Xpp.MetadataSupport class in my c# application I get an error:
System.BadImageFormatException was unhandled
FileName=aoskernel, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
FusionLog==== Pre-bind state information ===
LOG: DisplayName = aoskernel, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/SrvAxUtility/srvAx7SDK/srvAx7SDK.MDprocessingConsoleApp/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : Microsoft.Dynamics.AX.Xpp.Support, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\SrvAxUtility\srvAx7SDK\srvAx7SDK.MDprocessingConsoleApp\bin\Debug\srvAx7SDK.ConsoleApp.vshost.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: aoskernel, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/SrvAxUtility/srvAx7SDK/srvAx7SDK.MDprocessingConsoleApp/bin/Debug/aoskernel.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
HResult=-2147024885
Message=Could not load file or assembly 'aoskernel, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Source=Microsoft.Dynamics.AX.Xpp.Support
StackTrace:
at Microsoft.Dynamics.Ax.Xpp.MetadataSupport.GetTableExtensionNames(String tableName)
at srvAx7SDK.D365MDProvider.AxMDMapperForDataEntity.ReadEntityExtensionFields() in C:\SrvAxUtility\srvAx7SDK\srvAx7SDK.D365MDProvider\AxMDMapperForDataEntity.cs:line 51
at srvAx7SDK.D365MDProvider.AxMDMapperForDataEntity.DoMap() in C:\SrvAxUtility\srvAx7SDK\srvAx7SDK.D365MDProvider\AxMDMapperForDataEntity.cs:line 39
at srvAx7SDK.D365MDProvider.AxMDService.GetDataEntityByName(String _entityName) in C:\SrvAxUtility\srvAx7SDK\srvAx7SDK.D365MDProvider\AxMDService.cs:line 26
at srvAx7SDK.ConsoleInfrastructure.SrvEntityFieldsDescriptionOperation.PerformOperation() in C:\SrvAxUtility\srvAx7SDK\srvAx7SDK.MDProcessingInfrastructure\SrvEntityFieldsDescriptionOperation.cs:line 33
at srvAx7SDK.ConsoleApp.Program.Main(String[] args) in C:\SrvAxUtility\srvAx7SDK\srvAx7SDK.MDprocessingConsoleApp\Program.cs:line 20
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
I wanted to use that example but via c# AX7. Get information about table extension using Microsoft.Dynamics.Ax.Xpp.MetadataSupport
It is possible?