.net - How-to diagnose and fix such "on-site" crash of dotnet application? -


I am working on some application which has automatic update function. Implemented ideas are as simple as:
- There are some "starter" applications that are installed on "program files / jo / ...". This is an application that can be started by the user.
- Every time a "starter" application is executed, it checks for the server for updates and downloads it to "% APPDATA% / some / ...". And then it starts some application from that folder.

The above approach is working under the XP on my development machine (Vista) and some other machines, but some different machines (running Windows 7) are working when "starter "Impresses the actual application so it crashes with some unknown problem (signature = System.UnauthorizedAccess). When the actual application is executed manually with% APPDATA% / some / folder, then everything is working fine. I have tried to set up a single working directory in ProcessStartInfo, so the "Starter" will also execute the real application in that folder, but it does not help me.

How can I diagnose and / or correct the problem?

Updates
More information about how I am running the main process from a starter:

  Private static readonly string _ROOT = path Alliances (Environmental Gatefolder Path (Environmental Special Folder Application Form), "Miep"); ... run private static zero () {string startPath = Path.Combine (_ROOT, "MyApp.exe"); ProcessStartInfo startInfo = newest processinfo (); StartInfo.FileName = startPath; StartInfo.WorkingDirectory = _ROOT; Process.Start (startPath); }  

This definitely starts the right process because the application window can be seen, but some disk or network operations are probably rejected by Windows and the process starts . Update
Tracing is showing that the working directory was not correct and it pointed towards the wrong code. The start (string) method call is in my code. Correct line:

  process. Start (startInfo);  

As your problem, I give the difference that the accident is either a missing resource Or dependency or its a permission issue. Have you tried running the app using administrator permissions? Generally, since XP, every version of Windows is restricted more and this is especially true on the .net runtime. Are you dependent on third party libraries or DLLs?

To diagnose the problem, assuming that you do not have access to the debugger on a remote machine, your best bet is enough use of the system. Diagnostics . You can make tracing from your app.config configurable and easily redirect the reass in a local file. Also make sure to check the Event Viewer for any application level exceptions.

With time and adequate trace statement, you should get the problem quickly.

Enabling tracing is easy to add the following to your app.config.

  & lt; System.diagnostics & gt; & Lt; Trace autoflush = "true" indentsize = "3" & gt; & Lt; Listeners & gt; & Lt; Add name = "fileOutListener" type = "System.Diagnostics.TextWriterTraceListener" initializeData = "C: \ Path.to \ file \ debug.log" /> & Lt; / Listeners & gt; & Lt; / Trace & gt; & Lt; /system.diagnostics>  

Then add to your code:

  System.Diagnostics.Trace.Writeline (System.DateTime.ToString () + ":: Currently I have XX Location YY is doing ");  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -