I meet following exception when I copy the whole program directoy to another machine. Which tools can I employ to debug it? Thank you.
Unhandled Exception: System.TypeInitializationException: The type initializer fo
r ‘SomeClass’ threw an exceptio
n. —> System.IO.FileLoadException: Could not load file or assembly ‘SomeAssembly.dll, Version=0.0.0.0, Culture=neut
ral, PublicKeyToken=null’ or one of its dependencies. This application has faile
d to start because the application configuration is incorrect. Reinstalling the
application may fix this problem. (Exception from HRESULT: 0x800736B1)
File name: ‘SomeAssembly.dll, Version
=0.0.0.0, Culture=neutral, PublicKeyToken=null’ —> System.Runtime.InteropServi
ces.COMException (0x800736B1): This application has failed to start because the
application configuration is incorrect. Reinstalling the application may fix thi
s problem. (Exception from HRESULT: 0x800736B1)
It is a Windows error, not a .NET error. The error code is 14001, ERROR_SXS_CANT_GEN_ACTCTX, “The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail.”
Look in the Windows event log, it tells you what DLL you forgot to install on the target machine. If it is a mixed-mode assembly then it is typically the C/C++ runtime DLL, or you deployed the debug build.