{"action":"created","issue":{"url":"https://api.github.com/repos/MscrmTools/XrmToolBox/issues/293","labels_url":"https://api.github.com/repos/MscrmTools/XrmToolBox/issues/293/labels{/name}","comments_url":"https://api.github.com/repos/MscrmTools/XrmToolBox/issues/293/comments","events_url":"https://api.github.com/repos/MscrmTools/XrmToolBox/issues/293/events","html_url":"https://github.com/MscrmTools/XrmToolBox/issues/293","id":122742225,"number":293,"title":"SiteMap Editor crashes XrmToolBox when group is moved up multiple times","user":{"login":"mdocter","id":796916,"avatar_url":"https://avatars.githubusercontent.com/u/796916?v=3","gravatar_id":"","url":"https://api.github.com/users/mdocter","html_url":"https://github.com/mdocter","followers_url":"https://api.github.com/users/mdocter/followers","following_url":"https://api.github.com/users/mdocter/following{/other_user}","gists_url":"https://api.github.com/users/mdocter/gists{/gist_id}","starred_url":"https://api.github.com/users/mdocter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdocter/subscriptions","organizations_url":"https://api.github.com/users/mdocter/orgs","repos_url":"https://api.github.com/users/mdocter/repos","events_url":"https://api.github.com/users/mdocter/events{/privacy}","received_events_url":"https://api.github.com/users/mdocter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-17T14:14:26Z","updated_at":"2015-12-18T12:04:26Z","closed_at":null,"body":"**SiteMap Editor - symptom:**\r\nWhen I create a new group below an Area, the group is placed as last group. When I rapidly move it up multiple times by using the green arrow-up icon button, the whole XrmToolBox crashes.\r\n\r\n**Note:**\r\nThis only happens after working with the tool for a while (multiple modifications like cut/paste groups and publications etc.). I tried to reproduce it by opening a fresh XrmToolBox instance, opening the SiteMap Editor, Load SiteMap, Create a group and reorder it, but in that case it didn't happen... so the exact order of events to make it crash is currently a mystery to me. Today I was cleaning up a pretty large SiteMap and it already happened twice. And I had it before. Maybe other users noticed the same behavior and can help to pinpoint the order of events.\r\n\r\nThe following three errors are logged in the Windows Event Log:\r\n\r\n```xml\r\nLog Name:      Application\r\nSource:        Application Error\r\nDate:          17-12-15 14:38:14\r\nEvent ID:      1000\r\nTask Category: (100)\r\nLevel:         Error\r\nKeywords:      Classic\r\nUser:          N/A\r\nComputer:      lt-md\r\nDescription:\r\nFaulting application name: XrmToolBox.exe, version: 1.2015.11.5, time stamp: 0x563a8e6b\r\nFaulting module name: KERNELBASE.dll, version: 10.0.10240.16384, time stamp: 0x559f38c3\r\nException code: 0xc000041d\r\nFault offset: 0x000000000002a1c8\r\nFaulting process id: 0x413c\r\nFaulting application start time: 0x01d138b41ac9c054\r\nFaulting application path: H:\\Tools\\XrmToolBox2\\XrmToolBox.exe\r\nFaulting module path: C:\\WINDOWS\\system32\\KERNELBASE.dll\r\nReport Id: c3f552ba-0ddf-42a5-9dee-f333dd893390\r\nFaulting package full name: \r\nFaulting package-relative application ID: \r\nEvent Xml:\r\n<Event xmlns=\"http://schemas.microsoft.com/win/2004/08/events/event\">\r\n  <System>\r\n    <Provider Name=\"Application Error\" />\r\n    <EventID Qualifiers=\"0\">1000</EventID>\r\n    <Level>2</Level>\r\n    <Task>100</Task>\r\n    <Keywords>0x80000000000000</Keywords>\r\n    <TimeCreated SystemTime=\"2015-12-17T13:38:14.000000000Z\" />\r\n    <EventRecordID>15118</EventRecordID>\r\n    <Channel>Application</Channel>\r\n    <Computer>lt-md</Computer>\r\n    <Security />\r\n  </System>\r\n  <EventData>\r\n    <Data>XrmToolBox.exe</Data>\r\n    <Data>1.2015.11.5</Data>\r\n    <Data>563a8e6b</Data>\r\n    <Data>KERNELBASE.dll</Data>\r\n    <Data>10.0.10240.16384</Data>\r\n    <Data>559f38c3</Data>\r\n    <Data>c000041d</Data>\r\n    <Data>000000000002a1c8</Data>\r\n    <Data>413c</Data>\r\n    <Data>01d138b41ac9c054</Data>\r\n    <Data>H:\\Tools\\XrmToolBox2\\XrmToolBox.exe</Data>\r\n    <Data>C:\\WINDOWS\\system32\\KERNELBASE.dll</Data>\r\n    <Data>c3f552ba-0ddf-42a5-9dee-f333dd893390</Data>\r\n    <Data>\r\n    </Data>\r\n    <Data>\r\n    </Data>\r\n  </EventData>\r\n</Event>\r\n\r\nLog Name:      Application\r\nSource:        Application Error\r\nDate:          17-12-15 14:38:11\r\nEvent ID:      1000\r\nTask Category: (100)\r\nLevel:         Error\r\nKeywords:      Classic\r\nUser:          N/A\r\nComputer:      lt-md\r\nDescription:\r\nFaulting application name: XrmToolBox.exe, version: 1.2015.11.5, time stamp: 0x563a8e6b\r\nFaulting module name: KERNELBASE.dll, version: 10.0.10240.16384, time stamp: 0x559f38c3\r\nException code: 0xe0434352\r\nFault offset: 0x000000000002a1c8\r\nFaulting process id: 0x413c\r\nFaulting application start time: 0x01d138b41ac9c054\r\nFaulting application path: H:\\Tools\\XrmToolBox2\\XrmToolBox.exe\r\nFaulting module path: C:\\WINDOWS\\system32\\KERNELBASE.dll\r\nReport Id: 4c137b68-a3c4-4c40-ba98-366f9028345b\r\nFaulting package full name: \r\nFaulting package-relative application ID: \r\nEvent Xml:\r\n<Event xmlns=\"http://schemas.microsoft.com/win/2004/08/events/event\">\r\n  <System>\r\n    <Provider Name=\"Application Error\" />\r\n    <EventID Qualifiers=\"0\">1000</EventID>\r\n    <Level>2</Level>\r\n    <Task>100</Task>\r\n    <Keywords>0x80000000000000</Keywords>\r\n    <TimeCreated SystemTime=\"2015-12-17T13:38:11.000000000Z\" />\r\n    <EventRecordID>15116</EventRecordID>\r\n    <Channel>Application</Channel>\r\n    <Computer>lt-md</Computer>\r\n    <Security />\r\n  </System>\r\n  <EventData>\r\n    <Data>XrmToolBox.exe</Data>\r\n    <Data>1.2015.11.5</Data>\r\n    <Data>563a8e6b</Data>\r\n    <Data>KERNELBASE.dll</Data>\r\n    <Data>10.0.10240.16384</Data>\r\n    <Data>559f38c3</Data>\r\n    <Data>e0434352</Data>\r\n    <Data>000000000002a1c8</Data>\r\n    <Data>413c</Data>\r\n    <Data>01d138b41ac9c054</Data>\r\n    <Data>H:\\Tools\\XrmToolBox2\\XrmToolBox.exe</Data>\r\n    <Data>C:\\WINDOWS\\system32\\KERNELBASE.dll</Data>\r\n    <Data>4c137b68-a3c4-4c40-ba98-366f9028345b</Data>\r\n    <Data>\r\n    </Data>\r\n    <Data>\r\n    </Data>\r\n  </EventData>\r\n</Event>\r\n\r\nLog Name:      Application\r\nSource:        .NET Runtime\r\nDate:          17-12-15 14:38:11\r\nEvent ID:      1026\r\nTask Category: None\r\nLevel:         Error\r\nKeywords:      Classic\r\nUser:          N/A\r\nComputer:      lt-md\r\nDescription:\r\nApplication: XrmToolBox.exe\r\nFramework Version: v4.0.30319\r\nDescription: The process was terminated due to an unhandled exception.\r\nException Info: System.ComponentModel.Win32Exception\r\n   at System.Windows.Forms.NativeWindow.CreateHandle(System.Windows.Forms.CreateParams)\r\n   at System.Windows.Forms.Control.CreateHandle()\r\n   at System.Windows.Forms.Control.get_Handle()\r\n   at System.Windows.Forms.Control.CreateGraphicsInternal()\r\n   at System.Windows.Forms.ThreadExceptionDialog..ctor(System.Exception)\r\n   at System.Windows.Forms.Application+ThreadContext.OnThreadException(System.Exception)\r\n   at System.Windows.Forms.Control.WndProcException(System.Exception)\r\n   at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)\r\n\r\n\r\nEvent Xml:\r\n<Event xmlns=\"http://schemas.microsoft.com/win/2004/08/events/event\">\r\n  <System>\r\n    <Provider Name=\".NET Runtime\" />\r\n    <EventID Qualifiers=\"0\">1026</EventID>\r\n    <Level>2</Level>\r\n    <Task>0</Task>\r\n    <Keywords>0x80000000000000</Keywords>\r\n    <TimeCreated SystemTime=\"2015-12-17T13:38:11.000000000Z\" />\r\n    <EventRecordID>15115</EventRecordID>\r\n    <Channel>Application</Channel>\r\n    <Computer>lt-md</Computer>\r\n    <Security />\r\n  </System>\r\n  <EventData>\r\n    <Data>Application: XrmToolBox.exe\r\nFramework Version: v4.0.30319\r\nDescription: The process was terminated due to an unhandled exception.\r\nException Info: System.ComponentModel.Win32Exception\r\n   at System.Windows.Forms.NativeWindow.CreateHandle(System.Windows.Forms.CreateParams)\r\n   at System.Windows.Forms.Control.CreateHandle()\r\n   at System.Windows.Forms.Control.get_Handle()\r\n   at System.Windows.Forms.Control.CreateGraphicsInternal()\r\n   at System.Windows.Forms.ThreadExceptionDialog..ctor(System.Exception)\r\n   at System.Windows.Forms.Application+ThreadContext.OnThreadException(System.Exception)\r\n   at System.Windows.Forms.Control.WndProcException(System.Exception)\r\n   at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)\r\n\r\n</Data>\r\n  </EventData>\r\n</Event>\r\n```\r\n\r\n  \r\n"},"comment":{"url":"https://api.github.com/repos/MscrmTools/XrmToolBox/issues/comments/165764234","html_url":"https://github.com/MscrmTools/XrmToolBox/issues/293#issuecomment-165764234","issue_url":"https://api.github.com/repos/MscrmTools/XrmToolBox/issues/293","id":165764234,"user":{"login":"rappen","id":2572253,"avatar_url":"https://avatars.githubusercontent.com/u/2572253?v=3","gravatar_id":"","url":"https://api.github.com/users/rappen","html_url":"https://github.com/rappen","followers_url":"https://api.github.com/users/rappen/followers","following_url":"https://api.github.com/users/rappen/following{/other_user}","gists_url":"https://api.github.com/users/rappen/gists{/gist_id}","starred_url":"https://api.github.com/users/rappen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rappen/subscriptions","organizations_url":"https://api.github.com/users/rappen/orgs","repos_url":"https://api.github.com/users/rappen/repos","events_url":"https://api.github.com/users/rappen/events{/privacy}","received_events_url":"https://api.github.com/users/rappen/received_events","type":"User","site_admin":false},"created_at":"2015-12-18T12:04:26Z","updated_at":"2015-12-18T12:04:26Z","body":"Actually I just got it again... :-1: \r\n```\r\nAn unexpected error occured: System.ComponentModel.Win32Exception (0x80004005): Det gick inte att skapa fönsterreferensen.\r\n   vid System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)\r\n   vid System.Windows.Forms.Control.CreateHandle()\r\n   vid System.Windows.Forms.Control.get_Handle()\r\n   vid System.Windows.Forms.Control.CreateGraphicsInternal()\r\n   vid System.Windows.Forms.ThreadExceptionDialog..ctor(Exception t)\r\n   vid System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)\r\n   vid System.Windows.Forms.Control.WndProcException(Exception e)\r\n   vid System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n   vid System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n   vid System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)\r\n   vid System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n   vid System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n   vid XrmToolBox.Program.Main(String[] args)\r\n\r\nOne reason can be that at least one file is locked by Windows. Please unlock each locked files or unlock XrmToolBox.zip before extracting its content\r\n```"}}