在 .NET Core 解决方案中使用 Dynamics AX 2009 Business Connector .NET Framework 3.5

问题描述

我们正在研究 .NET Core 解决方案,其中请求与 Dynamics AX 2009 进行一些通信。

在 AX 中,我们需要从解决方案中调用一些静态方法。在其他 .NET Framework 解决方案中,我们使用了随 AX 一起安装的 Business Connector。这一直工作正常,但现在在 .NET Core 解决方案中,我们在 Autofac 解析过程中遇到异常:

Autofac.Core.DependencyResolutionException: 
An exception was thrown while invoking the constructor 'Void 
.ctor(Core.Configuration.AppConfig,Core.Logging.ILogger)' on type
'AxConnectionProvider'. ---> System.BadImageFormatException: Could not load file or assembly
'Microsoft.Dynamics.BusinessConnectorNet,Version=5.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35'. An attempt was made to load a program with an incorrect format. 

这是正确的,因为 .NET Core 不支持 Business Connector。

但是,为了使用 AX 2009 并从我们的 .NET Core 解决方案中调用静态方法,我们如何解决这个问题?

我们有一个 .NET Standard 库,其中包含了所有 AX 代码,并且包含了 Business Connector dll 作为参考。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)