Can't run Dependencies.exe on Windows Server 2012 Standard x64
See original GitHub issueUnhandled Exception: System.BadImageFormatException: Could not load file or assembly 'ClrPhlib.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)
at Dependencies.Program.Main(String[] args)
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Console Application Error on Windows 2012 server R2 ...
I have created a console application in visual studio 2013 on windows server 2012 standard version and the exe file seems to run...
Read more >How to use the Regsvr32 tool and troubleshoot ...
If this article does not describe the error message that you are ... Regsvr32.exe is installed in the %systemroot%\System32 folder in Windows XP...
Read more >Troubleshoot blocked .NET Framework installations and ...
NET Framework are in-place updates, you cannot install an earlier ... on Windows 8.1, Windows RT 8.1, and Windows Server 2012 R2 requires ......
Read more >System Requirements, Installation, and Driver Files
SQL version compatibility; Supported operating systems; Installing Microsoft ODBC Driver for SQL Server; Command-line tools: sqlcmd.exe and ...
Read more >Cluster group that has dependent resources does not fail ...
Symptoms. Consider the following scenario: You establish a failover cluster, and the clustered servers are running Windows Server 2012 R2, Windows Server ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok that was a fairly complicated bug to track down. What happened is, on Debug build
Dependencies.exe
failed to load the packagedmsvcp140d.dll
so -weirdly enough- the CLR loader folded back toMSVCR120_CLR0400.dll
. The loader which managed to loadClrPhlib.dll
, but crash whenever it attempted to jit a method from this module :My guess is
MSVCR120_CLR0400
is a VisualStudio 2015 redistribuable whileClrPhlib.dll
is built using VS2019, and I’ve hit a backward compatibility bug in CLR’s jitter. I did not bother to investigate further …Why I couldn’t load
msvcp140.dll
while being present in the packaged release ? Well because of a typo : I exported the 32-bit version on 64-bit builds ! Commit b6c3ce1ec42b81513a202eb5eac77ae8b5ff2f5d fix this issue.As you said here https://github.com/lucasg/Dependencies/issues/85#issuecomment-526645459, Release builds rely on api-ms-win-crt dlls (also known as “Universal CRT”). Commit 1d15d6e0b90e19d8953fdbbf5f577ec214f2ae3e package also the ucrt in release builds.
I’ve tested it on a Windows Server 2012 R2 stock VM with only .NET Framework 4.6.2, but I appreciate you confirm the fix on your end before closing this issue.
Build artifacts can be downloaded here : https://ci.appveyor.com/project/lucasg/dependencies/builds/27104909
Thanks for the info, I’ll look into it as well as your PR for apisets parsing @ww898
Well you know what they say, hindsight is 20/20 … One day I will rewrite the whole PE parsing in C# (Forshaw already wrote on for NtApiDotNet) and finally get rid of this C++/CLI monstruosity.