The error content is:
For more information about invoking just-in-time (JIT) debugging instead of this dialog box, see the end of this message. Exception text **************system.badimageformatexception: Failed to load file or assembly "Interop.word, Version=8.1.0.0, Culture=neutral, publickeytoken=NULL"or one of its dependencies. An attempt was made to load a program that is not properly formatted. File name: "Interop.word, Version=8.1.0.0, Culture=neutral, publickeytoken=NULL"in Pwms. PerForm.F_ManFile.but_Table_Click (Object sender, EventArgs e) in System.Windows.Forms.Button.OnMouseUp ( MouseEventArgs mevent) in System.Windows.Forms.Control.WmMouseUp (Message&m, mousebuttons button, Int32 clicks) in System.Windows.Forms.Control.WndProc (Message&m) in System.Windows.Forms.ButtonBase.WndProc (Message&m) in System.Windows.Forms.Button.WndProc (Message&m) in System.Windows.Forms.NativeWindow.Callback (IntPtr hWnd, Int32 msg, INTPTR wparam, INTPTR lparam) Warning: assembly binding logging is Shut down. To enable assembly binding failure logging, set the registry value [HKLM\Software\Microsoft\Fusion! Enablelog] (DWORD) is set to1. Note there will be some performance loss associated with the assembly binding failure logging. To turn off this feature, remove the registry value [HKLM\Software\Microsoft\Fusion! Enablelog].
Error Content
At first thought is the referenced library file Interop.word version of the wrong, the result of a long day or wrong. Finally, according to the article [1], it is known that the 32 version of the DLL when the execution of any CPU type of the executable file there is a great instability, when the 64-bit system runs this call 32dll code snippet, will occur as shown in the error. The lesson of blood, wasted 1 hours. I hope I won't make such a low-level mistake in future.
Reference code call: Download Link, spare.
Reference articles
1. System.badimageformatexception failed to load file or assembly
C # error when generating a Word document based on tabular data in a form