none
After moving to .Net 4.0 i get "System.InvalidProgramException: Common Language Runtime detected an invalid program" RRS feed

  • Question

  • We recently moved to Visual studio 2010 and upgraded to .Net 4.0 from .Net 3.5. I now get a System.InvalidProgramException when calling a 3rd party application's method (using Xheo [www.xheo.com] DeployLX licensing's validate method)... it used to work without problems with .Net 2.0 and then with .Net 3.5 on VS 2008.

    According to what i've found about this error, it was reported back in the day for .Net 2.0 and fixed with a hotfix. (http://blogs.msdn.com/mjeelani/archive/2006/12/09/common-language-runtime-detected-an-invalid-program-invalidprogramexception-when-your-application-has-a-really-large-method.aspx)

    Not sure if this is an issue with CLR restricting the number of variables in .Net 4.0 or something else but i would really appreciate if you could provide some guidance.

    The application is being run on a 64 bit machine but the build settings are set to target 32 bit systems.

    Hoping for a quick resolution to this...

    Regards.

    Salman Khalid.

    Tuesday, May 4, 2010 6:31 PM

All replies

  • I guess you have a stable repro, right? Get a (native) call stack and paste it here. That could help us find out what happened.

    -Karel

    Wednesday, May 5, 2010 12:27 AM
    Moderator
  • I guess you have a stable repro, right? Get a (native) call stack and paste it here. That could help us find out what happened.

    -Karel


    Hi Karel,

    Thank you for the response... here is the entire stack trace: (I have commented out the line that calls the Validate method on Xheo to get the application working for the time being... and have also contacted Xheo to make sure they are aware of this and see if they have any solution to this either)

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    System.InvalidProgramException: Common Language Runtime detected an invalid program.
       at DeployLX.Licensing.v3.LicenseValidationRequestInfo..ctor()
       at Tradepoint.POS.ConfigurationMain.ApplicationLoad(Object sender, EventArgs e) in C:\Salman\Workbench\VS Projects\Tradepoint POS\Premier Retail\Premier Retail\Premier Configuration\Forms\ConfigurationMain.vb:line 172
       at System.EventHandler.Invoke(Object sender, EventArgs e)
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at DevExpress.XtraEditors.XtraForm.OnLoad(EventArgs e)
       at System.Windows.Forms.Form.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WmShowWindow(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at DevExpress.XtraEditors.XtraForm.WndProc(Message& msg)
       at DevExpress.XtraBars.Ribbon.RibbonForm.WndProc(Message& msg)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
    ----------------------------------------
    Tradepoint.POS
        Assembly Version: 2010.0.0.0
        Win32 Version: 2010.0.0
        CodeBase: file:///C:/Salman/Workbench/VS%20Projects/Tradepoint%20POS/Premier%20Retail/Premier%20Retail/bin/x86/Debug/Tradepoint.POS.exe
    ----------------------------------------
    DevExpress.Utils.v10.1
        Assembly Version: 10.1.3.0
        Win32 Version: 10.1.3.0
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/DevExpress.Utils.v10.1/10.1.3.0__b88d1754d700e49a/DevExpress.Utils.v10.1.dll
    ----------------------------------------
    System
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    DevExpress.XtraBars.v10.1
        Assembly Version: 10.1.3.0
        Win32 Version: 10.1.3.0
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/DevExpress.XtraBars.v10.1/10.1.3.0__b88d1754d700e49a/DevExpress.XtraBars.v10.1.dll
    ----------------------------------------
    Tradepoint.POS.Common
        Assembly Version: 2010.0.0.0
        Win32 Version: 2010.0.0
        CodeBase: file:///C:/Salman/Workbench/VS%20Projects/Tradepoint%20POS/Premier%20Retail/Premier%20Retail/bin/x86/Debug/Tradepoint.POS.Common.DLL
    ----------------------------------------
    Microsoft.VisualBasic
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
    ----------------------------------------
    System.Core
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
    ----------------------------------------
    System.Data
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
    ----------------------------------------
    Evolution.Windows
        Assembly Version: 1.0.3777.21082
        Win32 Version: 1.0.3777.21082
        CodeBase: file:///C:/Salman/Workbench/VS%20Projects/Tradepoint%20POS/Premier%20Retail/Premier%20Retail/bin/x86/Debug/Evolution.Windows.DLL
    ----------------------------------------
    Evolution.API
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase: file:///C:/Salman/Workbench/VS%20Projects/Tradepoint%20POS/Premier%20Retail/Premier%20Retail/bin/x86/Debug/Evolution.API.DLL
    ----------------------------------------
    System.Data.Entity
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.Entity/v4.0_4.0.0.0__b77a5c561934e089/System.Data.Entity.dll
    ----------------------------------------
    System.Xml
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    System.Configuration
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    Darwin.Utilities
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase: file:///C:/Salman/Workbench/VS%20Projects/Tradepoint%20POS/Premier%20Retail/Premier%20Retail/bin/x86/Debug/Darwin.Utilities.DLL
    ----------------------------------------
    System.Transactions
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
    ----------------------------------------
    System.EnterpriseServices
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
    ----------------------------------------
    Tradepoint.POS.SharedLibrary.Profiler
        Assembly Version: 2010.0.0.0
        Win32 Version: 2010.0.0
        CodeBase: file:///C:/Salman/Workbench/VS%20Projects/Tradepoint%20POS/Premier%20Retail/Premier%20Retail/bin/x86/Debug/Tradepoint.POS.SharedLibrary.Profiler.DLL
    ----------------------------------------
    DevExpress.OfficeSkins.v10.1
        Assembly Version: 10.1.3.0
        Win32 Version: 10.1.3.0
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/DevExpress.OfficeSkins.v10.1/10.1.3.0__95fc6c5621878f0a/DevExpress.OfficeSkins.v10.1.dll
    ----------------------------------------
    DevExpress.BonusSkins.v10.1
        Assembly Version: 10.1.3.0
        Win32 Version: 10.1.3.0
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/DevExpress.BonusSkins.v10.1/10.1.3.0__95fc6c5621878f0a/DevExpress.BonusSkins.v10.1.dll
    ----------------------------------------
    DevExpress.Data.v10.1
        Assembly Version: 10.1.3.0
        Win32 Version: 10.1.3.0
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/DevExpress.Data.v10.1/10.1.3.0__b88d1754d700e49a/DevExpress.Data.v10.1.dll
    ----------------------------------------
    DevExpress.XtraTreeList.v10.1
        Assembly Version: 10.1.3.0
        Win32 Version: 10.1.3.0
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/DevExpress.XtraTreeList.v10.1/10.1.3.0__b88d1754d700e49a/DevExpress.XtraTreeList.v10.1.dll
    ----------------------------------------
    DevExpress.XtraEditors.v10.1
        Assembly Version: 10.1.3.0
        Win32 Version: 10.1.3.0
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/DevExpress.XtraEditors.v10.1/10.1.3.0__b88d1754d700e49a/DevExpress.XtraEditors.v10.1.dll
    ----------------------------------------
    DeployLX.Licensing.v3
        Assembly Version: 3.1.2000.0
        Win32 Version: 3.1.2000.19165
        CodeBase: file:///C:/Salman/Workbench/VS%20Projects/Tradepoint%20POS/Premier%20Retail/Premier%20Retail/bin/x86/Debug/DeployLX.Licensing.v3.DLL
    ----------------------------------------
    Tradepoint.POS.resources
        Assembly Version: 2010.0.0.0
        Win32 Version: 2010.0.0
        CodeBase: file:///C:/Salman/Workbench/VS%20Projects/Tradepoint%20POS/Premier%20Retail/Premier%20Retail/bin/x86/Debug/en/Tradepoint.POS.resources.DLL
    ----------------------------------------
    Tradepoint.POS.TradepointSplashScreen
        Assembly Version: 2010.0.0.0
        Win32 Version: 2010.0.0
        CodeBase: file:///C:/Salman/Workbench/VS%20Projects/Tradepoint%20POS/Premier%20Retail/Premier%20Retail/bin/x86/Debug/Tradepoint.POS.TradepointSplashScreen.DLL
    ----------------------------------------
    Tradepoint.POS.Business
        Assembly Version: 2010.0.0.0
        Win32 Version: 2010.0.0
        CodeBase: file:///C:/Salman/Workbench/VS%20Projects/Tradepoint%20POS/Premier%20Retail/Premier%20Retail/bin/x86/Debug/Tradepoint.POS.Business.DLL
    ----------------------------------------
    Tradepoint.POS.Configurations
        Assembly Version: 2010.0.0.0
        Win32 Version: 2010.0.0
        CodeBase: file:///C:/Salman/Workbench/VS%20Projects/Tradepoint%20POS/Premier%20Retail/Premier%20Retail/bin/x86/Debug/Tradepoint.POS.Configurations.DLL
    ----------------------------------------
    Tradepoint.POS.ConfigurationLogic
        Assembly Version: 2010.0.0.0
        Win32 Version: 2010.0.0
        CodeBase: file:///C:/Salman/Workbench/VS%20Projects/Tradepoint%20POS/Premier%20Retail/Premier%20Retail/bin/x86/Debug/Tradepoint.POS.ConfigurationLogic.DLL
    ----------------------------------------
    Tradepoint.POS.SharedLibrary.TradepointMessageBox
        Assembly Version: 2010.0.0.0
        Win32 Version: 2010.0.0
        CodeBase: file:///C:/Salman/Workbench/VS%20Projects/Tradepoint%20POS/Premier%20Retail/Premier%20Retail/bin/x86/Debug/Tradepoint.POS.SharedLibrary.TradepointMessageBox.DLL
    ----------------------------------------
    PresentationFramework
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.dll
    ----------------------------------------
    WindowsBase
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/WindowsBase/v4.0_4.0.0.0__31bf3856ad364e35/WindowsBase.dll
    ----------------------------------------
    PresentationCore
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/PresentationCore/v4.0_4.0.0.0__31bf3856ad364e35/PresentationCore.dll
    ----------------------------------------
    System.Xaml
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xaml/v4.0_4.0.0.0__b77a5c561934e089/System.Xaml.dll
    ----------------------------------------

    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.

    For example:

    <configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>

    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.


    Regards.

    Salman Khalid.

    Wednesday, May 5, 2010 6:20 PM
  • On an additional note...

    One thing i did notice and i failed to bring to attention here is this:
    "Could not load file or assembly 'DeployLX.Licensing.v3.dll' or one of its dependencies. Invalid access to memory location. (Exception from HRESULT: 0x800703E6)"
     
    When i debug the project, i get the message above on the following line in the code behind...

    Dim resources As System.ComponentModel. ComponentResourceManager = New System.ComponentModel. ComponentResourceManager ( GetType ( MainForm ))

    Not sure if this could be related to the System.InvalidProgramException that we get or if it indicates DeployLX being not .Net 4.0 ready yet...  Hopefully Xheo will be responding quickly and we'd get a response on the forum soon too.

    I've tried removing the app and reinstalling but same result... plus it works on VS2008/Net3.5 so not really sure what could be the cause here...

    Regards.
    Salman Khalid.
    Wednesday, May 5, 2010 6:28 PM