[Python.NET] Re: BadImageFormatException or FileNotFoundException- pythonnet and AlphaVSS

Denis Akhiyarov <[email protected]> Mon, 11 Jul 2022 12:23:42 -0500
Newsgroups gmane.comp.python.dotnet
Message-ID <CALxxJLTEE1HUiVEHuFzLFKJLSmxeviUmp-YnGLr9T0-hF+pN-A@mail.gmail.com>
--===============6415144058140094234==
Content-Type: multipart/alternative; boundary="000000000000f105d105e38ad023"

--000000000000f105d105e38ad023
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

This one is quite common error, but things might have changed in .net core
since this wiki was written:

https://github.com/pythonnet/pythonnet/wiki/Troubleshooting-on-Windows,-Lin=
ux,-and-OSX


On Mon, Jul 11, 2022 at 12:11 PM Steven Manross <[email protected]> wrote:

> Thanks for that: Dependency walker was what I needed to see why it was
> having issues.
>
>
>
> This DLL depends on the .NET Core and Visual C++ Redist (both are
> installed but it still cant see particular files like:
> API-MS-WIN-CORE-PROCESSTHREADS-L1-1-3.DLL).  Searching for this and other
> files it is missing, revealed that they are not present on the Server.
> From what I=E2=80=99ve googled, there could be an issue with the dll link=
ing to
> files that were moved to other libraries in current OSes.
>
>
>
> Thank you for your help.
>
>
>
> Steven
>
> *From:* Mark Visser <[email protected]>
> *Sent:* Monday, July 11, 2022 8:02 AM
> *To:* A list for users and developers of Python.NET <[email protected]=
>
> *Subject:* [Python.NET] Re: BadImageFormatException or
> FileNotFoundException- pythonnet and AlphaVSS
>
>
>
> +1 - in the past I've used https://www.dependencywalker.com/ to figure
> out the problem. On mac you can use otool -L, and on linux you can use ld=
d.
>
>
>
> On Jul 11, 2022, at 9:38 AM, Alex Earl <[email protected]> wrote:
>
>
>
> Sometimes the file not found error occurs because a dependency of the dll
> can not be found.
>
>
>
> On Sun, Jul 10, 2022, 20:06 Steven Manross <[email protected]> wrote:
>
> Howdy all,
>
>
>
> I am somewhat new to pythonnet and .NET programming, and just joined the
> mailing list.  You have my apologies if I am missing something simple.  I
> am aware that BadImageFormatException suggests that I=E2=80=99m trying to=
 open an
> x64 DLL on a 32-bit OS or python installation (or vice versa), but neithe=
r
> seem to be the case (that I can tell).  Depending on exactly how I call t=
he
> code, I get a File Not Found or Bad Image Exception.
>
>
>
> The File Not Found is interesting since the files live in the same
> directory as a working DLL (AlphaVSS.Common works - built to run on any
> architecture, AlphaVSS.x64 doesn=E2=80=99t).
>
>
>
> Specifics:
>
> * Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929
> 64 bit (AMD64)] on win32
>
> * uninstalled Python 3.10 temporarily so I cant get you that detail (sorr=
y)
>
> * And the Windows version clearly states it=E2=80=99s Windows Server 2016=
 x64
>
>
>
> I=E2=80=99m doing my testing from ipython.
>
>
>
> The code below was tested with Python 3.9 x64 (pythonnet 2.5.2 via wheel
> file) and Python 3.10 x64 (installed pythonnet 3.0.0-dev1 from git master=
 a
> few days ago) on Windows Server 2016 x64 Evaluation patched for current
> .NET Frameworks 2022-06 and both produce an error on the following code.
>
>
>
> AlphaVSS DLLs were generated via powershell/nuget, and I just copied the
> DLLs from my powershellmodules dir to the =E2=80=9Cclr_dir=E2=80=9D below=
 for testing
> (documentation suggests you copy the files to the same directory for use)=
.
> This DLL was created for .NET Framework 4.5 and I=E2=80=99ve installed Fr=
amework
> 4.8 and this Cumulative update:
>
>
>
>    - 2022-06 Cumulative Update for .NET Framework 4.8 for Windows Server
>    2016 for x64 (KB5014630)
>
>
>
> This code is eventually intended to manipulate the Volume Shadow Copy
> Service on Windows.  I am aware that there is limited functionality for
> ShadowCopies from DISKSHADOW and WMI, but wanted to get more functionalit=
y
> from this VSS .NET Library (specifically Shadow Copy Sets), and pythonnet
> seemed like a great way to implement this code in my favorite scripting
> language.
>
>
>
> Here is the documentation for the DLLs (version 2.0.0) if anyone wants
> that:
>
> https://alphavss.alphaleonis.com/api/Alphaleonis.Win32.Vss.html
>
>
>
> git source:
>
> https://github.com/alphaleonis/AlphaVSS
>
>
>
> I double checked permissions on the DLLs and I have full control as the
> administrator.  UAC is completely turned off on this machine (if it
> matters).
>
>
>
> Any suggestions would be appreciated.  This is a test system, so I can do
> just about anything to it including rebuilding it from scratch as it was
> built specifically for testing this.  This is a VM on Hyper-V 2016 (I dou=
bt
> that matters).
>
>
>
> Thank you for your time!
>
>
>
> Steven
>
> #   ipython dir output
> In [16]: ! dir "c:\users\administrator\desktop\alphavss"
>
> Volume in drive C has no label.
>
> Volume Serial Number is 8C70-F8A3
>
>
>
> Directory of c:\users\administrator\desktop\alphavss
>
>
>
> 07/09/2022  03:10 AM    <DIR>          .
>
> 07/09/2022  03:10 AM    <DIR>          ..
>
> 12/03/2019  08:37 PM            69,632 AlphaVSS.Common.dll
>
> 12/03/2019  08:37 PM            21,408 AlphaVSS.Common.pdb
>
> 12/03/2019  08:37 PM           618,522 AlphaVSS.Common.xml
>
> 12/03/2019  08:37 PM           325,120 AlphaVSS.x64.dll
>
> 12/03/2019  08:37 PM           271,872 AlphaVSS.x86.dll
>
> 12/03/2019  08:29 PM           342,392 Ijwhost.dll
>
> 07/09/2022  03:09 AM    <DIR>          runtimes
>
> 07/09/2022  03:10 AM    <DIR>          win-x64
>
> 07/09/2022  03:10 AM    <DIR>          win-x86
>
>
>
> # code
>
> import sys
>
> import clr
>
> import System
>
> # from System import Reflection
>
>
>
> clr_dir =3D "C:\\Users\\Administrator\\Desktop\\AlphaVSS"
>
> if clr_dir not in sys.path:
>
>     sys.path.append(clr_dir)
>
>
>
> # common_vss =3D
> Reflection.Assembly.LoadFile(f'{clr_dir}\\AlphaVSS.Common.dll')
>
> clr.AddReference("AlphaVSS.Common") #pylint:disable=3DI1101
>
>
>
> import Alphaleonis.Win32.Vss as alphavss
>
>
>
>
>
> # clr.AddReference("AlphaVSS.x64") #pylint:disable=3DI1101
>
> vss =3D alphavss.VssFactoryProvider.Default
>
> # x64_vss =3D Reflection.Assembly.LoadFile(f'{clr_dir}\\AlphaVSS.x64.dll'=
)
>
> # BadImageFormatException: An attempt was made to load a program with an
> incorrect format. (Exception from HRESULT: 0x8007000B)
>
>
>
> try:
>
>     factory =3D vss.GetVssFactory()
>
> except System.BadImageFormatException as e:
>
>     print(f'Bad Image Format: {e}')
>
> except OSError as e:
>
>     # FileNotFoundException: Could not load file or assembly
> 'AlphaVSS.x64, Version=3D2.0.0.0, Culture=3Dneutral,
> PublicKeyToken=3D959d3993561034e3' or one of its dependencies. The system
> cannot find the file specified.
>
>     print(f'File Not Found: {e}')
>
> _______________________________________________
> PythonNet mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/pythonnet.python.org/
> Member address: [email protected]
>
> _______________________________________________
> PythonNet mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/pythonnet.python.org/
> Member address: [email protected]
>
>
> _______________________________________________
> PythonNet mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/pythonnet.python.org/
> Member address: [email protected]
>

--000000000000f105d105e38ad023
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto">This one is quite common error, but things might have cha=
nged in .net core since this wiki was written:</div><div dir=3D"auto"><br><=
/div><div dir=3D"auto"><div><a href=3D"https://github.com/pythonnet/pythonn=
et/wiki/Troubleshooting-on-Windows,-Linux,-and-OSX">https://github.com/pyth=
onnet/pythonnet/wiki/Troubleshooting-on-Windows,-Linux,-and-OSX</a></div><b=
r></div><div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail=
_attr">On Mon, Jul 11, 2022 at 12:11 PM Steven Manross &lt;<a href=3D"mailt=
o:[email protected]">[email protected]</a>&gt; wrote:<br></div><blockquot=
e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
id;padding-left:1ex">





<div lang=3D"EN-US" link=3D"blue" vlink=3D"purple" style=3D"word-wrap:break=
-word">
<div class=3D"m_5730013012669532956WordSection1">
<p class=3D"MsoNormal">Thanks for that: Dependency walker was what I needed=
 to see why it was having issues.<u></u><u></u></p>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<p class=3D"MsoNormal">This DLL depends on the .NET Core and Visual C++ Red=
ist (both are installed but it still cant see particular files like: API-MS=
-WIN-CORE-PROCESSTHREADS-L1-1-3.DLL).=C2=A0 Searching for this and other fi=
les it is missing, revealed that they are
 not present on the Server.=C2=A0 From what I=E2=80=99ve googled, there cou=
ld be an issue with the dll linking to files that were moved to other libra=
ries in current OSes.<u></u><u></u></p>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<p class=3D"MsoNormal">Thank you for your help.<u></u><u></u></p>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<p class=3D"MsoNormal">Steven<u></u><u></u></p>
<div>
<div style=3D"border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in =
0in 0in">
<p class=3D"MsoNormal"><b>From:</b> Mark Visser &lt;<a href=3D"mailto:markv=
@unity3d.com" target=3D"_blank">[email protected]</a>&gt; <br>
<b>Sent:</b> Monday, July 11, 2022 8:02 AM<br>
<b>To:</b> A list for users and developers of Python.NET &lt;<a href=3D"mai=
lto:[email protected]" target=3D"_blank">[email protected]</a>&gt;<br=
>
<b>Subject:</b> [Python.NET] Re: BadImageFormatException or FileNotFoundExc=
eption- pythonnet and AlphaVSS<u></u><u></u></p>
</div>
</div>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<p class=3D"MsoNormal">+1 - in the past I&#39;ve used=C2=A0<a href=3D"https=
://www.dependencywalker.com/" target=3D"_blank">https://www.dependencywalke=
r.com/</a>=C2=A0to figure out the problem. On mac you can use otool -L, and=
 on linux you can use ldd.<u></u><u></u></p>
<div>
<p class=3D"MsoNormal"><br>
<br>
<u></u><u></u></p>
<blockquote style=3D"margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class=3D"MsoNormal">On Jul 11, 2022, at 9:38 AM, Alex Earl &lt;<a href=
=3D"mailto:[email protected]" target=3D"_blank">[email protected]</=
a>&gt; wrote:<u></u><u></u></p>
</div>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<div>
<div>
<p class=3D"MsoNormal">Sometimes the file not found error occurs because a =
dependency of the dll can not be found.=C2=A0<u></u><u></u></p>
</div>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<div>
<div>
<p class=3D"MsoNormal">On Sun, Jul 10, 2022, 20:06 Steven Manross &lt;<a hr=
ef=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>&g=
t; wrote:<u></u><u></u></p>
</div>
<blockquote style=3D"border:none;border-left:solid #cccccc 1.0pt;padding:0i=
n 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class=3D"MsoNormal">Howdy all,<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">I am somewhat new to pythonnet and .NET programming,=
 and just joined the mailing list.=C2=A0 You have my apologies if I am miss=
ing something simple.=C2=A0 I am aware that BadImageFormatException
 suggests that I=E2=80=99m trying to open an x64 DLL on a 32-bit OS or pyth=
on installation (or vice versa), but neither seem to be the case (that I ca=
n tell).=C2=A0 Depending on exactly how I call the code, I get a File Not F=
ound or Bad Image Exception.<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">The File Not Found is interesting since the files li=
ve in the same directory as a working DLL (AlphaVSS.Common works - built to=
 run on any architecture, AlphaVSS.x64 doesn=E2=80=99t).<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">Specifics:<u></u><u></u></p>
<p class=3D"MsoNormal">* Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, =
16:36:42) [MSC v.1929 64 bit (AMD64)] on win32<u></u><u></u></p>
<p class=3D"MsoNormal">* uninstalled Python 3.10 temporarily so I cant get =
you that detail (sorry)<u></u><u></u></p>
<p class=3D"MsoNormal">* And the Windows version clearly states it=E2=80=99=
s Windows Server 2016 x64<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">I=E2=80=99m doing my testing from ipython.<u></u><u>=
</u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">The code below was tested with Python 3.9 x64 (pytho=
nnet 2.5.2 via wheel file) and Python 3.10 x64 (installed pythonnet 3.0.0-d=
ev1 from git master a few days ago) on Windows Server
 2016 x64 Evaluation patched for current .NET Frameworks 2022-06 and both p=
roduce an error on the following code.
<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">AlphaVSS DLLs were generated via powershell/nuget, a=
nd I just copied the DLLs from my powershellmodules dir to the =E2=80=9Cclr=
_dir=E2=80=9D below for testing (documentation suggests you copy the
 files to the same directory for use).=C2=A0 This DLL was created for .NET =
Framework 4.5 and I=E2=80=99ve installed Framework 4.8 and this Cumulative =
update:<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<ul type=3D"disc">
<li class=3D"m_5730013012669532956m-2275646643585513278msolistparagraph">
2022-06 Cumulative Update for .NET Framework 4.8 for Windows Server 2016 fo=
r x64 (KB5014630)<u></u><u></u></li></ul>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">This code is eventually intended to manipulate the V=
olume Shadow Copy Service on Windows.=C2=A0 I am aware that there is limite=
d functionality for ShadowCopies from DISKSHADOW and WMI,
 but wanted to get more functionality from this VSS .NET Library (specifica=
lly Shadow Copy Sets), and pythonnet seemed like a great way to implement t=
his code in my favorite scripting language.
<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">Here is the documentation for the DLLs (version 2.0.=
0) if anyone wants that:<u></u><u></u></p>
<p class=3D"MsoNormal"><a href=3D"https://alphavss.alphaleonis.com/api/Alph=
aleonis.Win32.Vss.html" target=3D"_blank">https://alphavss.alphaleonis.com/=
api/Alphaleonis.Win32.Vss.html</a><u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">git source:<u></u><u></u></p>
<p class=3D"MsoNormal"><a href=3D"https://github.com/alphaleonis/AlphaVSS" =
target=3D"_blank">https://github.com/alphaleonis/AlphaVSS</a><u></u><u></u>=
</p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">I double checked permissions on the DLLs and I have =
full control as the administrator.=C2=A0 UAC is completely turned off on th=
is machine (if it matters).<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">Any suggestions would be appreciated.=C2=A0 This is =
a test system, so I can do just about anything to it including rebuilding i=
t from scratch as it was built specifically for testing
 this.=C2=A0 This is a VM on Hyper-V 2016 (I doubt that matters).<u></u><u>=
</u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">Thank you for your time!<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">Steven<u></u><u></u></p>
<p class=3D"MsoNormal"># =C2=A0=C2=A0ipython dir output<br>
In [16]: ! dir &quot;c:\users\administrator\desktop\alphavss&quot;<u></u><u=
></u></p>
<p class=3D"MsoNormal">Volume in drive C has no label.<u></u><u></u></p>
<p class=3D"MsoNormal">Volume Serial Number is 8C70-F8A3<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">Directory of c:\users\administrator\desktop\alphavss=
<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">07/09/2022=C2=A0 03:10 AM=C2=A0=C2=A0=C2=A0 &lt;DIR&=
gt;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .<u></u><u></u></=
p>
<p class=3D"MsoNormal">07/09/2022=C2=A0 03:10 AM=C2=A0=C2=A0=C2=A0 &lt;DIR&=
gt;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ..<u></u><u></u><=
/p>
<p class=3D"MsoNormal">12/03/2019=C2=A0 08:37 PM=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 69,632 AlphaVSS.Common.dll<u></u><u=
></u></p>
<p class=3D"MsoNormal">12/03/2019=C2=A0 08:37 PM=C2=A0=C2=A0 =C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A021,408 AlphaVSS.Common.pdb<u></u>=
<u></u></p>
<p class=3D"MsoNormal">12/03/2019=C2=A0 08:37 PM=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 618,522 AlphaVSS.Common.xml<u></u><u></u>=
</p>
<p class=3D"MsoNormal">12/03/2019=C2=A0 08:37 PM=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 325,120 AlphaVSS.x64.dll<u></u><u></u></p=
>
<p class=3D"MsoNormal">12/03/2019=C2=A0 08:37 PM=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 271,872 AlphaVSS.x86.dll<u></u><u></u></p=
>
<p class=3D"MsoNormal">12/03/2019=C2=A0 08:29 PM=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 342,392 Ijwhost.dll<u></u><u></u></p>
<p class=3D"MsoNormal">07/09/2022=C2=A0 03:09 AM=C2=A0=C2=A0=C2=A0 &lt;DIR&=
gt;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 runtimes<u></u><u=
></u></p>
<p class=3D"MsoNormal">07/09/2022=C2=A0 03:10 AM=C2=A0=C2=A0=C2=A0 &lt;DIR&=
gt;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 win-x64<u></u><u>=
</u></p>
<p class=3D"MsoNormal">07/09/2022=C2=A0 03:10 AM=C2=A0=C2=A0=C2=A0 &lt;DIR&=
gt;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 win-x86<u></u><u>=
</u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal"># code<u></u><u></u></p>
<p class=3D"MsoNormal">import sys<u></u><u></u></p>
<p class=3D"MsoNormal">import clr<u></u><u></u></p>
<p class=3D"MsoNormal">import System<u></u><u></u></p>
<p class=3D"MsoNormal"># from System import Reflection<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">clr_dir =3D &quot;C:\\Users\\Administrator\\Desktop\=
\AlphaVSS&quot;
<u></u><u></u></p>
<p class=3D"MsoNormal">if clr_dir not in sys.path:<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0=C2=A0=C2=A0 sys.path.append(clr_dir)<u></u><u=
></u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal"># common_vss =3D Reflection.Assembly.LoadFile(f&#39;=
{clr_dir}\\AlphaVSS.Common.dll&#39;)<u></u><u></u></p>
<p class=3D"MsoNormal">clr.AddReference(&quot;AlphaVSS.Common&quot;) #pylin=
t:disable=3DI1101<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">import Alphaleonis.Win32.Vss as alphavss<u></u><u></=
u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal"># clr.AddReference(&quot;AlphaVSS.x64&quot;) #pylint=
:disable=3DI1101<u></u><u></u></p>
<p class=3D"MsoNormal">vss =3D alphavss.VssFactoryProvider.Default<u></u><u=
></u></p>
<p class=3D"MsoNormal"># x64_vss =3D Reflection.Assembly.LoadFile(f&#39;{cl=
r_dir}\\AlphaVSS.x64.dll&#39;)<u></u><u></u></p>
<p class=3D"MsoNormal"># BadImageFormatException: An attempt was made to lo=
ad a program with an incorrect format. (Exception from HRESULT: 0x8007000B)=
<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0<u></u><u></u></p>
<p class=3D"MsoNormal">try:<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0=C2=A0=C2=A0 factory =3D vss.GetVssFactory()<u=
></u><u></u></p>
<p class=3D"MsoNormal">except System.BadImageFormatException as e:<u></u><u=
></u></p>
<p class=3D"MsoNormal">=C2=A0=C2=A0=C2=A0 print(f&#39;Bad Image Format: {e}=
&#39;)<u></u><u></u></p>
<p class=3D"MsoNormal">except OSError as e:<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0=C2=A0=C2=A0 # FileNotFoundException: Could no=
t load file or assembly &#39;AlphaVSS.x64, Version=3D2.0.0.0, Culture=3Dneu=
tral, PublicKeyToken=3D959d3993561034e3&#39; or one of its dependencies. Th=
e system
 cannot find the file specified.<u></u><u></u></p>
<p class=3D"MsoNormal">=C2=A0=C2=A0=C2=A0 print(f&#39;File Not Found: {e}&#=
39;)<u></u><u></u></p>
</div>
</div>
<p class=3D"MsoNormal">_______________________________________________<br>
PythonNet mailing list -- <a href=3D"mailto:[email protected]" target=3D=
"_blank">[email protected]</a><br>
To unsubscribe send an email to <a href=3D"mailto:[email protected]=
g" target=3D"_blank">
[email protected]</a><br>
<a href=3D"https://mail.python.org/mailman3/lists/pythonnet.python.org/" ta=
rget=3D"_blank">https://mail.python.org/mailman3/lists/pythonnet.python.org=
/</a><br>
Member address: <a href=3D"mailto:[email protected]" target=3D"_blank">=
[email protected]</a><u></u><u></u></p>
</blockquote>
</div>
<p class=3D"MsoNormal">_______________________________________________<br>
PythonNet mailing list -- <a href=3D"mailto:[email protected]" target=3D=
"_blank">[email protected]</a><br>
To unsubscribe send an email to <a href=3D"mailto:[email protected]=
g" target=3D"_blank">[email protected]</a><br>
<a href=3D"https://mail.python.org/mailman3/lists/pythonnet.python.org/" ta=
rget=3D"_blank">https://mail.python.org/mailman3/lists/pythonnet.python.org=
/</a><br>
Member address: <a href=3D"mailto:[email protected]" target=3D"_blank">mark=
[email protected]</a><u></u><u></u></p>
</div>
</blockquote>
</div>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
</div>
</div>

_______________________________________________<br>
PythonNet mailing list -- <a href=3D"mailto:[email protected]" target=3D=
"_blank">[email protected]</a><br>
To unsubscribe send an email to <a href=3D"mailto:[email protected]=
g" target=3D"_blank">[email protected]</a><br>
<a href=3D"https://mail.python.org/mailman3/lists/pythonnet.python.org/" re=
l=3D"noreferrer" target=3D"_blank">https://mail.python.org/mailman3/lists/p=
ythonnet.python.org/</a><br>
Member address: <a href=3D"mailto:[email protected]" target=3D"_bla=
nk">[email protected]</a><br>
</blockquote></div></div>

--000000000000f105d105e38ad023--

--===============6415144058140094234==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
PythonNet mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/pythonnet.python.org/
Member address: [email protected]

--===============6415144058140094234==--