MscrmTools / XrmToolBox

An application that gather multiple tools to ease the customization and configuration of Microsoft Dynamics CRM/365/Dataverse/PowerApps
https://www.xrmtoolbox.com
GNU General Public License v3.0
574 stars 216 forks source link

Xrmtoolbox keep crashing #929

Open naveedmcp opened 4 years ago

naveedmcp commented 4 years ago

After I get the latest update (as shown in pic), the xrmtoolbox keeps closing every 2-3 minutes.

image

rappen commented 4 years ago

Any specific tools you are running when it crashes?

airiclenz commented 4 years ago

I can confirm this issue. It seems to crash while / after connecting. Version 1.2020.2.37 In general it seems to be very random and intermittent.

I am running Windows in a Virtual Machine and the issue started showing up 3 or 4 months ago.

MscrmTools commented 4 years ago

If random and/or intermittent, it seems really complicated to find the issue... Is it possible to run XrmToolBox from Visual Studio and find out what part of code fails?

naveedmcp commented 4 years ago

Hi Just downloaded the latest version 39. its still crashing. the one not crashing is version 35. but it quiet old and most of the tools are failing to load.

naveedmcp commented 4 years ago

One of the error.

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

** Exception Text ** System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 52.240.159.111:443 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)

** Loaded Assemblies ** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.7.3620.0 built by: NET472REL1LAST_B CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll

XrmToolBox Assembly Version: 1.2020.5.39 Win32 Version: 1.2020.5.39 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/XrmToolBox.exe

System.Core Assembly Version: 4.0.0.0 Win32 Version: 4.7.3620.0 built by: NET472REL1LAST_B CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

System Assembly Version: 4.0.0.0 Win32 Version: 4.7.3451.0 built by: NET472REL1LAST_C CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

XrmToolBox.Extensibility Assembly Version: 1.2020.5.39 Win32 Version: 1.2020.5.39 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/XrmToolBox.Extensibility.DLL

System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.7.3580.0 built by: NET472REL1LAST_C 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.7.3056.0 built by: NET472REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

Microsoft.IdentityModel Assembly Version: 3.5.0.0 Win32 Version: 10.0.17134.885 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.IdentityModel/3.5.0.0__31bf3856ad364e35/Microsoft.IdentityModel.dll

System.IO.Compression.FileSystem Assembly Version: 4.0.0.0 Win32 Version: 4.7.3056.0 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.IO.Compression.FileSystem/v4.0_4.0.0.0__b77a5c561934e089/System.IO.Compression.FileSystem.dll

System.IO.Compression Assembly Version: 4.0.0.0 Win32 Version: 4.7.3056.0 built by: NET472REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.IO.Compression/v4.0_4.0.0.0__b77a5c561934e089/System.IO.Compression.dll

XrmToolBox.PluginsStore Assembly Version: 1.2020.5.39 Win32 Version: 1.2020.5.39 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/XrmToolBox.PluginsStore.DLL

NuGet.Core Assembly Version: 2.14.0.832 Win32 Version: 2.14.0.832 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/NuGet.Core.DLL

Newtonsoft.Json Assembly Version: 12.0.0.0 Win32 Version: 12.0.3.23909 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/Newtonsoft.Json.DLL

McTools.Xrm.Connection Assembly Version: 1.2020.5.33 Win32 Version: 1.2020.5.33 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/McTools.Xrm.Connection.DLL

McTools.Xrm.Connection.WinForms Assembly Version: 1.2020.5.33 Win32 Version: 1.2020.5.33 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/McTools.Xrm.Connection.WinForms.DLL

Microsoft.Xrm.Sdk Assembly Version: 9.0.0.0 Win32 Version: 9.0.45.329 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/Microsoft.Xrm.Sdk.DLL

Microsoft.Xrm.Sdk.Workflow Assembly Version: 9.0.0.0 Win32 Version: 9.0.45.329 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/Microsoft.Xrm.Sdk.Workflow.DLL

Microsoft.Crm.Sdk.Proxy Assembly Version: 9.0.0.0 Win32 Version: 9.0.45.329 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/Microsoft.Crm.Sdk.Proxy.DLL

Microsoft.Xrm.Tooling.Connector Assembly Version: 4.0.0.0 Win32 Version: 4.0.0.51 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/Microsoft.Xrm.Tooling.Connector.DLL

Microsoft.Xrm.Tooling.Ui.Styles Assembly Version: 4.0.0.0 Win32 Version: 4.0.0.51 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/Microsoft.Xrm.Tooling.Ui.Styles.DLL

Microsoft.Xrm.Tooling.CrmConnectControl Assembly Version: 4.0.0.0 Win32 Version: 4.0.0.51 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/Microsoft.Xrm.Tooling.CrmConnectControl.DLL

Microsoft.IdentityModel.Clients.ActiveDirectory Assembly Version: 5.2.7.0 Win32 Version: 5.2.7.0 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/Microsoft.IdentityModel.Clients.ActiveDirectory.DLL

WeifenLuo.WinFormsUI.Docking Assembly Version: 3.0.6.0 Win32 Version: 3.0.6.0 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/WeifenLuo.WinFormsUI.Docking.DLL

WeifenLuo.WinFormsUI.Docking.ThemeVS2015 Assembly Version: 3.0.6.0 Win32 Version: 3.0.6.0 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/WeifenLuo.WinFormsUI.Docking.ThemeVS2015.DLL

ScintillaNET Assembly Version: 3.6.3.0 Win32 Version: 3.6.3.0 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/ScintillaNET.DLL

System.Configuration Assembly Version: 4.0.0.0 Win32 Version: 4.7.3056.0 built by: NET472REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Xml Assembly Version: 4.0.0.0 Win32 Version: 4.7.3056.0 built by: NET472REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

System.Net.Http Assembly Version: 4.1.1.3 Win32 Version: 4.6.26907.01 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/System.Net.Http.DLL

System.Runtime.Serialization Assembly Version: 4.0.0.0 Win32 Version: 4.7.3620.0 built by: NET472REL1LAST_B CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll

SMDiagnostics Assembly Version: 4.0.0.0 Win32 Version: 4.7.3620.0 built by: NET472REL1LAST_B CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/SMDiagnostics/v4.0_4.0.0.0__b77a5c561934e089/SMDiagnostics.dll

System.ServiceModel.Internals Assembly Version: 4.0.0.0 Win32 Version: 4.7.3620.0 built by: NET472REL1LAST_B CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ServiceModel.Internals/v4.0_4.0.0.0__31bf3856ad364e35/System.ServiceModel.Internals.dll

Microsoft.GeneratedCode Assembly Version: 1.0.0.0 Win32 Version: 4.7.3056.0 built by: NET472REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

McTools.StopAdvertisement Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///C:/Project%20Work/D365/XrmToolbox/McTools.StopAdvertisement.DLL

System.Xml.Linq Assembly Version: 4.0.0.0 Win32 Version: 4.7.3056.0 built by: NET472REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll

Microsoft.GeneratedCode Assembly Version: 1.0.0.0 Win32 Version: 4.7.3056.0 built by: NET472REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

Microsoft.GeneratedCode Assembly Version: 1.0.0.0 Win32 Version: 4.7.3056.0 built by: NET472REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

Microsoft.GeneratedCode Assembly Version: 1.0.0.0 Win32 Version: 4.7.3056.0 built by: NET472REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

System.ComponentModel.Composition Assembly Version: 4.0.0.0 Win32 Version: 4.7.3056.0 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.Composition/v4.0_4.0.0.0__b77a5c561934e089/System.ComponentModel.Composition.dll

naveedmcp commented 4 years ago

Updates to this issue. The Tool keeps crashing immediately after connecting to the crm or saving any setting from configuration menu

Application: XrmToolBox.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.Exception at McTools.Xrm.Connection.ConnectionManager.LoadConnectionsList() at McTools.Xrm.Connection.ConnectionManager.fsw_Changed(System.Object, System.IO.FileSystemEventArgs) at System.IO.FileSystemWatcher.OnChanged(System.IO.FileSystemEventArgs) at System.IO.FileSystemWatcher.CompletionStatusChanged(UInt32, UInt32, System.Threading.NativeOverlapped) at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32, UInt32, System.Threading.NativeOverlapped)

Faulting application name: XrmToolBox.exe, version: 1.2020.5.39, time stamp: 0x5ebe81e3 Faulting module name: KERNELBASE.dll, version: 10.0.17134.1425, time stamp: 0xb54b6e3b Exception code: 0xe0434352 Fault offset: 0x000000000003a308 Faulting process id: 0x4fb8 Faulting application start time: 0x01d63463d0b4eb3c Faulting application path: C:\Project Work\D365\XrmToolbox\XrmToolBox.exe Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll Report Id: 34b81dfe-9c59-4e9c-8965-bbfff4b98e04 Faulting package full name: Faulting package-relative application ID:

XRMTool version; 1.2020.5.39

MscrmTools commented 4 years ago

I will try to handle exceptions in the faulty method to try to understand as I don't reproduce the issue so far

naveedmcp commented 4 years ago

I will try to handle exceptions in the faulty method to try to understand as I don't reproduce the issue so far

When this new release will be available?

MscrmTools commented 4 years ago

I should be able to handle this next week (or maybe tomorrow but nothing sure) and ship a pre release

naveedmcp commented 4 years ago

I should be able to handle this next week (or maybe tomorrow but nothing sure) and ship a pre release

Hi,

Any updates on the fix or new version?

MscrmTools commented 4 years ago

Not yet... I'm quite busy these days

MscrmTools commented 4 years ago

@naveedmcp Found 5 minutes to add a quick and dirty log around the faulty method. Should crash the same but a "connection_debug.log" file should be in XrmToolBox execution folder.

Can you test with these assemblies (replace them in XrmToolBox execution folder)?

McTools.Xrm.Connection.zip

scubaracer commented 4 years ago

I'm having the same problems, with me it happens when I connect using clientid / secret. "Normal"connections seem fine.

scubaracer commented 4 years ago

@MscrmTools After copying the files from McTools.Xrm.Connection.zip I could connect with clientid/secret without crashing.

MscrmTools commented 4 years ago

This is quite strange since these files only add more tracing but does not change the behavior...

scubaracer commented 4 years ago

I know but before the copy, it crashed when I opened a plugin after connecting with client/secret. After no problems.

From: MscrmTools notifications@github.com Sent: woensdag 15 juli 2020 09:45 To: MscrmTools/XrmToolBox XrmToolBox@noreply.github.com Cc: scubaracer danieljanse@hotmail.com; Comment comment@noreply.github.com Subject: Re: [MscrmTools/XrmToolBox] Xrmtoolbox keep crashing (#929)

This is quite strange since these files only add more tracing but does not change the behavior...

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/MscrmTools/XrmToolBox/issues/929#issuecomment-658604272, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIPA7C47OCGXNXCKNK7NQF3R3VNAPANCNFSM4K5ST3NQ.

scubaracer commented 4 years ago

Update, yesterday all worked fine the whole day. Now this morging the toolbox crashes directly. The error in the log: 16-07-20 07:53:23 LoadConnectionsList There is an error in XML document (0, 0).

MscrmTools commented 4 years ago

It seems one of your connection file got corrupted...

scubaracer commented 4 years ago

No that’s not it. The connection file is ok, when I start. When I then click a client/secret connectionstring connection, the code executes CrmConnections.LoadFromFile (which it already did, otherwise I could not select the connection). Then for some reason it clears the file on the background and then reads it. Then the error occurs. I’m debugging it now

From: MscrmTools notifications@github.com Sent: donderdag 16 juli 2020 14:04 To: MscrmTools/XrmToolBox XrmToolBox@noreply.github.com Cc: scubaracer danieljanse@hotmail.com; Comment comment@noreply.github.com Subject: Re: [MscrmTools/XrmToolBox] Xrmtoolbox keep crashing (#929)

It seems one of your connection file got corrupted...

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/MscrmTools/XrmToolBox/issues/929#issuecomment-659366175, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIPA7C6HYZOV25MKU2Y5VR3R33UBHANCNFSM4K5ST3NQ.

scubaracer commented 4 years ago

Ok, don’t judge the code, was just a try. It seems the file gets updated, so I tried this. First checking if the file was not empty and then wait for trying again.

   public static CrmConnections LoadFromFile(string filePath)
    {
        var crmConnections = new CrmConnections("Default");

        if (!Uri.IsWellFormedUriString(filePath, UriKind.Absolute) && !File.Exists(filePath))
        {
            return crmConnections;
        }

        using (var fStream = OpenStream(filePath))
        {
            if (fStream.Length > 0)
            {
                return (CrmConnections)XmlSerializerHelper.Deserialize(fStream, typeof(CrmConnections), typeof(ConnectionDetail));
            }

        }

        Thread.Sleep(1000);
        // try again
        using (var fStream = OpenStream(filePath))
        {
            return (CrmConnections)XmlSerializerHelper.Deserialize(fStream, typeof(CrmConnections), typeof(ConnectionDetail));
        }

    }

From: MscrmTools notifications@github.com Sent: donderdag 16 juli 2020 14:04 To: MscrmTools/XrmToolBox XrmToolBox@noreply.github.com Cc: scubaracer danieljanse@hotmail.com; Comment comment@noreply.github.com Subject: Re: [MscrmTools/XrmToolBox] Xrmtoolbox keep crashing (#929)

It seems one of your connection file got corrupted...

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/MscrmTools/XrmToolBox/issues/929#issuecomment-659366175, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIPA7C6HYZOV25MKU2Y5VR3R33UBHANCNFSM4K5ST3NQ.

MscrmTools commented 4 years ago

So, does this code fix the issue?

scubaracer commented 4 years ago

Yes it seems like it. I wouldn't send it didn't help 😄

Verzonden vanaf mijn Samsung Galaxy-smartphone.

-------- Oorspronkelijk bericht -------- Van: MscrmTools notifications@github.com Datum: 16-07-2020 15:55 (GMT+01:00) Aan: MscrmTools/XrmToolBox XrmToolBox@noreply.github.com Cc: scubaracer danieljanse@hotmail.com, Comment comment@noreply.github.com Onderwerp: Re: [MscrmTools/XrmToolBox] Xrmtoolbox keep crashing (#929)

So, does this code fix the issue?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/MscrmTools/XrmToolBox/issues/929#issuecomment-659428511, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIPA7CYND7MJIRQHQAGV2RLR34BEZANCNFSM4K5ST3NQ.

scubaracer commented 4 years ago

What I'm interested in, is why the connection file is read and parsed so many times. On startup but also when you click the connection in the bottom of the form. Etc..

Verzonden vanaf mijn Samsung Galaxy-smartphone.

-------- Oorspronkelijk bericht -------- Van: MscrmTools notifications@github.com Datum: 16-07-2020 15:55 (GMT+01:00) Aan: MscrmTools/XrmToolBox XrmToolBox@noreply.github.com Cc: scubaracer danieljanse@hotmail.com, Comment comment@noreply.github.com Onderwerp: Re: [MscrmTools/XrmToolBox] Xrmtoolbox keep crashing (#929)

So, does this code fix the issue?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/MscrmTools/XrmToolBox/issues/929#issuecomment-659428511, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIPA7CYND7MJIRQHQAGV2RLR34BEZANCNFSM4K5ST3NQ.

MscrmTools commented 4 years ago

This is certainly due to historical reason... As you can create a connection when you need to connect, then the file needs to be saved. But I'm ok the file shouldn't be saved so many times

scubaracer commented 4 years ago

No problem, just what I noticed and it created a timing issue I think. I couldn't work without the toolbox 😄

Verzonden vanaf mijn Samsung Galaxy-smartphone.

-------- Oorspronkelijk bericht -------- Van: MscrmTools notifications@github.com Datum: 16-07-2020 16:17 (GMT+01:00) Aan: MscrmTools/XrmToolBox XrmToolBox@noreply.github.com Cc: scubaracer danieljanse@hotmail.com, Comment comment@noreply.github.com Onderwerp: Re: [MscrmTools/XrmToolBox] Xrmtoolbox keep crashing (#929)

This is certainly due to historical reason... As you can create a connection when you need to connect, then the file needs to be saved. But I'm ok the file shouldn't be saved so many times

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/MscrmTools/XrmToolBox/issues/929#issuecomment-659442043, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIPA7C5DUMT2RCP6ABIWFWLR34DV5ANCNFSM4K5ST3NQ.

scubaracer commented 4 years ago

@MscrmTools could you build Mscrmtools with this code change for me? Then I can really try it, I can't build it myself as its password protected. What's stange that with the normal version I could work almost the whole day, then I started the toolbox again and then time after time it crashed.

fainelia commented 4 years ago

Hello, not sure if it helps: I get this issue on Windows Server 2012 R2. on Windows 10 - no issues Xrmtoolbox version 1.2020.10.41 Any advice will be highly appreciated

fainelia commented 4 years ago

Hello I was able to resolve this issue on my side by updating the proxy of XRMToolBox and opening the access to 52.240.159.111:443 from the company proxy. https://www.xrmtoolbox.com/documentation/for-users/xrmtoolbox-settings/

jdpottle commented 3 years ago

I was getting this same error every time I started up, although I just needed to click Continue and everything would seem to be fine. I tried removing all settings/plugins/etc but that did nothing. However, I went into Proxy settings and selected the option to use Proxy settings from Internet Explorer and that fixed the error. One interesting thing is that after I made that change, the next time I logged in, I got messages on several of my plugins, as well as the main application itself that new versions were available. Looks like it was unable to check for updates at all.

MscrmTools commented 3 years ago

Good catch! so maybe I need to handle a bit better exception when searching for updates

ganeshkashim commented 3 years ago

@MscrmTools - Is this resolved ? I am still getting the same error as @naveedmcp

MscrmTools commented 3 years ago

If you read this thread, you should understand that this is something that you need to fix on your side. You are using a proxy and need to configure XrmToolBox accordingly or ask your IT guys to let traffic goes out.

There is also some resolution procedure on this issue

ganeshkashim commented 3 years ago

@MscrmTools Thank you for your quick response. I appreciate it!