C # error when generating a Word document based on tabular data in a form

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.