none
Common Language Runtime detected an invalid program. RRS feed

  • Question

  • Hello,

    I am using Microsoft Custom Translator and suddenly I started getting a runtime error.

    I updated my .NET framework and Windows Visual C++ but that didn't solve my issue.

    I also uncheck the code optimization option in Visual Basic but that doesn't work too.

    Any help is much appreciated. Thanks in advance.

    --

    Vishakha

    Wednesday, July 25, 2018 2:11 PM

All replies

  • Hi Vishakha121,

    Thank you for posting here.

    For your question, please do some personal check first. 

    1. Close your VS and restart your application again. And then if the issue still exist, please open your control panel> Click Programs and Features. Right click your Visual Studio, choose Change to repair your VS. If the error still exists, it is not dependent on your VS.

    2. Please check your application, do the application works well before? If it is, have you do some change before you get the runtime error?

    Here is a old blog about the error for your reference.

    https://blogs.msdn.microsoft.com/mjeelani/2006/12/09/common-language-runtime-detected-an-invalid-program-invalidprogramexception-when-your-application-has-a-really-large-method/

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, July 30, 2018 1:36 AM
    Moderator
  • Usually, this error is seen if you try to run 64-bit DLL under a 32-bit process (while if you try to run 32-bit DLLs under 64-bit process, it'll throw BadImageException instead)

    If your code is configured to compile as "Any CPU", try figure out what "reference" you've added recently by comparing .vbconfig file of your project in your source control. Sometime adding reference to 32-bit COM component will change the JIT behaviour to generate 32-bit EXE even if the OS it's running on is 64-bit.

    Monday, July 30, 2018 3:14 AM
    Answerer