I have some application that installed on few client machines (maybe 10 uptoday).
All the machines have Windows 7, with .NET 4.0+ installed. With installed Solid Edge ST6.
On 2 client machines, the application crashes on some activity, while on other machines all works fine.
I can't debug the application on the client machines, so i wrote some logger.
This logger writes every activity of the application to text file, so i can recognize where the application crashes.
So the log record from the client:
Connecting to Solid Edge
Connected to Solid Edge
Getting active document as Assembly
Active Assembly File Name: \\SERVER\Users\Yakov\ARAMA-BENET\IB\ABEC-4012-W\AB
This activity log tells that the application successfully connected to the Solid Edge application object, connected to its Active Document as Assembly Document and then try to get reference to the occurrences collection.
On this state the application just crashes (regular windows message, that the application have to close. No exception data).
The code of the activity:
public bool Flat_Single_Assembly(out string Message)
Settings = Settings.Load();
Single_Part_Flatter.Settings = Settings;
Message = "";
bool Result = true;
Logger.Log("Connecting to Solid Edge");
Solid_Edge_Application = Single_Part_Flatter.Connect_To_Solid_Edge();
Solid_Edge_Application.DisplayAlerts = false;
Solid_Edge_Application.Visible = true;
Solid_Edge_Application.Interactive = true;
if (Solid_Edge_Application != null)
SolidEdgeAssembly.AssemblyDocument SE_Active_Assembly = null;
Logger.Log("Getting active document as Assembly");
SE_Active_Assembly = Solid_Edge_Application.ActiveDocument as SolidEdgeAssembly.AssemblyDocument;
Logger.Log("Unable to get active document as Assembly");
if (SE_Active_Assembly != null)
if (SE_Active_Assembly != null)
Logger.Log("Active Assembly File Name: "+ SE_Active_Assembly.FullName);
SolidEdgeAssembly.Occurrences SE_Occurrences = SE_Active_Assembly.Occurrences;
if (SE_Occurrences != null)
SolidEdgeAssembly.Occurrence SE_Occurrence = null;
Status_String = "Preparing task list...";
if (Status_Changed != null)
So as You can see, the crash occures after Logger.Log("Get SE_Active_Assembly.Occurrences"); and before Logger.Log("Fill_Occurrence_List");
Maybe someone know, what could be the reason of crash, or some way to get closer to the exception causing crash?
In my case it's inpossible to install development environment (Visual Studio) on client machines.
I have just a view observation:
1) Does your logger write the message immediately or is the output buffered? In this case, you may only see the messages since the buffer was output the last time.
2) What does the Status_Changed() call do? Maybe it crashes there?
3) Did you check the crashlog file for any additional hint on the crash location? This file can be typically found under C:\Users\<USERNAME>\AppData\Local\Temp\crashlogf.t
The Logger writes the log directly at the moment of call.
It just appends the message to the text file.
The Status_Changed() is a call to rise the event Status_Changed, so the user interface form can handle this event, and update status label. So, before i call the Status_Changed() event i check if there is some method subscribed for the event and can handle it.
If there is no method linked to the event it can actually cause unhalded exception, but it this case Status_Handle will be Null and this line of code won't run.
About the crashlogf.txt, i think that i checked this file for some hints, but haven't found something interesting there. I'll check this file one more time. Maybe i've missed something.
Also i'll try to log every line of code in this place. Betwin the Logger.Log("Get SE_Active_Assembly.Occurrences"); and Logger.Log("Fill_Occurrence_List");.
Maybe it will point me to the specific line cause the crash.
Thank You for Your hints