You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thanks for the nice library. I just had to migrate my setup to a new laptop and after some fiddling around I found out that somehow only the older 0.7 version works "out of the box".
Output with version 0.7 on python 3.6 32bit:
from msl.loadlib import LoadLibrary
net = LoadLibrary("Microsoft.Dynamics.BusinessConnectorNet", "net")
Traceback (most recent call last):
File "C:\Python36\lib\site-packages\msl\loadlib\load_library.py", line 230, in init
self._assembly = clr.System.Reflection.Assembly.LoadFile(self._path)
System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
at System.Reflection.Assembly.LoadFile(String path)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "C:\Python36\lib\site-packages\msl\loadlib\load_library.py", line 242, in init
raise IOError(msg)
OSError: The library appears to be from a .NET Framework version < 4.0.
The useLegacyV2RuntimeActivationPolicy property was added to C:\Python36\python.exe.config
to fix the "System.IO.FileLoadException: Mixed mode assembly..." error.
Rerun the script, or shutdown and restart the interactive console, to see
if Python can now load the .NET library.
When doing the same thing again it now "just works".
With version 0.8 although, I only always got:
System.IO.FileNotFoundException: Unable to find assembly 'Microsoft.Dynamics.BusinessConnectorNet'.
at Python.Runtime.CLRModule.AddReference(String name)
So apparently no helpful "useLegacyV2RuntimeActivationPolicy property was added to C:\Python36\python.exe.config" magic was done.
Sorry if this is expected behaviour now.
BR.
The text was updated successfully, but these errors were encountered:
lovetheguitar
changed the title
Version 0.7 works with "Microsoft.Dynamics.BusinessConnectorNet.dll" but 0.8 does not
Version 0.7 works with "Microsoft.Dynamics.BusinessConnectorNet.dll" but 0.8 does not (with py3.6 32bit)
Apr 8, 2021
lovetheguitar
changed the title
Version 0.7 works with "Microsoft.Dynamics.BusinessConnectorNet.dll" but 0.8 does not (with py3.6 32bit)
Version 0.7 works with "Microsoft.Dynamics.BusinessConnectorNet.dll" but 0.8 does not (win10 64bit with py3.6 32bit)
Apr 8, 2021
Thanks for raising this issue. It is a bug and not a feature in version 0.8.
I have pushed a potential fix. Could you please verify that it "just works" after updating your version from the master branch?
Could you first move the C:\Python36\python.exe.config file to another folder before verifying so that the first run raises the OSError: The library appears to be from a .NET Framework version < 4.0 message and then the library loads properly on the second run.
Hey,
thanks for the nice library. I just had to migrate my setup to a new laptop and after some fiddling around I found out that somehow only the older 0.7 version works "out of the box".
Output with version 0.7 on python 3.6 32bit:
at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
at System.Reflection.Assembly.LoadFile(String path)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "C:\Python36\lib\site-packages\msl\loadlib\load_library.py", line 242, in init
raise IOError(msg)
OSError: The library appears to be from a .NET Framework version < 4.0.
The useLegacyV2RuntimeActivationPolicy property was added to C:\Python36\python.exe.config
to fix the "System.IO.FileLoadException: Mixed mode assembly..." error.
Rerun the script, or shutdown and restart the interactive console, to see
if Python can now load the .NET library.
When doing the same thing again it now "just works".
With version 0.8 although, I only always got:
System.IO.FileNotFoundException: Unable to find assembly 'Microsoft.Dynamics.BusinessConnectorNet'.
at Python.Runtime.CLRModule.AddReference(String name)
So apparently no helpful "useLegacyV2RuntimeActivationPolicy property was added to C:\Python36\python.exe.config" magic was done.
Sorry if this is expected behaviour now.
BR.
The text was updated successfully, but these errors were encountered: