Page 1 of 1

1C and Dynamix AX

Posted: Thu Dec 22, 2011 7:31 am
by speterburger
There are any samples or solution using Ne Business Connector from 1C Enterprise 8.2?

Re: 1C and Dynamix AX

Posted: Wed Dec 28, 2011 6:09 am
by Elisy
You can try Elisy .Net Bridge 4 plug-in to access .NET Business Connector. The 1C script sample will be like this:

Code: Select all

//Elisy .Net Bridge initialization
AttachAddIn("Elisy.NetBridge4");
AddIn = New("AddIn.ElisyNetBridge4");
net = AddIn.GetNet();

net.LoadAssemblyFrom("<pathto>\microsoft.dynamics.businessconnectornet.dll");
ax = net.New("Microsoft.Dynamics.BusinessConnectorNet.Axapta");
ax.Logon("", "", "", "");

o = ax.CallStaticClassMethod("SysLabel", "labelId2String2", "@SYS21669");

b = ax.Logoff();


Re: 1C and Dynamix AX

Posted: Thu Dec 29, 2011 6:28 am
by speterburger
net.LoadAssemblyFrom("C:\Windows\assembly\GAC_32\Microsoft.Dynamics.BusinessConnectorNet\5.0.0.0__31bf3856ad364e35\Microsoft.Dynamics.BusinessConnectorNet.dll");

Произошла исключительная ситуация (Elisy.NetBridge.dll): System.Reflection.TargetInvocationException: Адресат вызова создал исключение. ---> System.IO.FileLoadException: Сборка для смешанного режима построена на основе версии "v2.0.50727" среды выполнения и не может быть загружена в среде выполнения 4.0 без дополнительных конфигурационных данных.

Re: 1C and Dynamix AX

Posted: Tue Jan 03, 2012 8:36 am
by Elisy
speterburger wrote:net.LoadAssemblyFrom("C:\Windows\assembly\GAC_32\Microsoft.Dynamics.BusinessConnectorNet\5.0.0.0__31bf3856ad364e35\Microsoft.Dynamics.BusinessConnectorNet.dll");

Произошла исключительная ситуация (Elisy.NetBridge.dll): System.Reflection.TargetInvocationException: Адресат вызова создал исключение. ---> System.IO.FileLoadException: Сборка для смешанного режима построена на основе версии "v2.0.50727" среды выполнения и не может быть загружена в среде выполнения 4.0 без дополнительных конфигурационных данных.

This error shows that Microsoft.Dynamics.BusinessConnectorNet.dll has been targeted to .Net 2.0. If it's impossible to find assembly targeted to the more modern .Net framework 4.0 you should add configuration file named like the exe with .config extention.
For example to resolve this situation at 1C 8.2 you should try to create the file 1cv8c.exe.config added into the attachment . It's described in
http://www.davidmoore.info/2010/12/17/running-net-2-runtime-applications-under-the-net-4-runtime/
http://stackoverflow.com/questions/1604663/what-does-uselegacyv2runtimeactivationpolicy-do-in-the-net-4-config
It's xml-file containing:

Code: Select all

<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
  </startup>
   <runtime>
      <NetFx40_LegacySecurityPolicy enabled="true"/>
   </runtime>
</configuration>

1cv8c.zip
1cv8c.exe.config file
(273 Bytes) Downloaded 3478 times