Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

Dynamics SL 2015 SDK Upgrade Error 5046

(0) ShareShare
ReportReport
Posted on by 6,431

Upgrading a SL 2011 SDK project to SL 2015.  Have done this with other projects, and had success.  One particular project is throwing System Message 5046 "Invalid memory array handle passed to kernel" when running the project in Debug Mode.  Cannot figure out what the problem is.  Anyone have any thoughts they can share on what to review?

*This post is locked for comments

  • Verified answer
    Mark E Profile Picture
    Mark E 6,431 on at
    RE: Dynamics SL 2015 SDK Upgrade Error 5046

    OK, I went back to ground zero, started the conversion process over again, changed the Target Framework to .NET Framework 4, replaced any missing or invalid references, and seem to have it working.  The problem might have been in the initial pass of running the DynamicsSLSDKConversion.exe Utility, I had selected the option to "Remove Assembly Reference", which may have buggered up the conversion.

  • Mark E Profile Picture
    Mark E 6,431 on at
    RE: Dynamics SL 2015 SDK Upgrade Error 5046

    I tried replacing the DSLGrid control, but that did not change the results.  Thanks for the suggestions, though.  I'll keep researching.

  • RE: Dynamics SL 2015 SDK Upgrade Error 5046

    I suspect, and that is only a guess, that there is something wrong with the grid control since SL grids use a memory array and this error is related to an attempt to access an array out of bounds of the array.  I am also assuming that this project works fine under SL 2011.  For what it is worth, I have lots of projects that use SL grid controls and have not encountered a problem with SL 2015 grids on projects converted from 2011 to 2015 so I do not believe it is a basic conversion problem.  Sorry I could not be of that much help.

  • Mark E Profile Picture
    Mark E 6,431 on at
    RE: Dynamics SL 2015 SDK Upgrade Error 5046

    Yes, a screen that is loading a grid.  DBNAV for the grid is "SOHeader_all", "bcompany.cpnyid"; 0; 0; 0; 0, "bcustomer.custid"; 0; 0; 0; 1,

    Error happens when loading the project, cannot get past that action.

    I'm baffled currently...

  • RE: Dynamics SL 2015 SDK Upgrade Error 5046

    Without seeing the actual project it is hard to be of much help.  I am assuming the project is for a screen.  Does the screen contain an SL grid object?  If so, what is the DBNAV for the grid?  At what point does the error occur?  During form load or after entering something on the screen?

  • Mark E Profile Picture
    Mark E 6,431 on at
    RE: Dynamics SL 2015 SDK Upgrade Error 5046

    Rick,

    Thanks, but not sure that is my problem here.  I went ahead and commented out some basic code in the Form_Load event, and now I am seeing this:

    System.AccessViolationException was unhandled

     HResult=-2147467261

     Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

     Source=System.Windows.Forms

     StackTrace:

          at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageA(MSG& msg)

          at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)

          at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)

          at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)

          at System.Windows.Forms.Application.Run(ApplicationContext context)

          at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()

          at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()

          at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)

          at EM17100.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81

     InnerException:

  • Suggested answer
    RE: Dynamics SL 2015 SDK Upgrade Error 5046

    Mark, not sure if this helps or not but one of my projects got that error after converting to SL 2015 and I found out it was caused by the code not detecting an empty array (empty because no data was found to populate it).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,407 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans