system.diagnostics

Running a program with System.Diagnostics.Process.Start causes a MissingMethodException

Hi, I'm working on a Compact Framework 2.0 project, and I'm trying to launch a program "B" from within another program "A" using Process.Start. I've done this several times before, but I'm running into some weird issues this time. Program "B" does launch, but it causes a MissingMethodException, basically telling me that it is missing ...

How to determine whether a System.Diagnostics.Process is 32 or 64 bit?

I tried: process.MainModule.FileName.Contains("x86") But it threw an exception for a x64 process: Win32Exception: Only a part of the ReadProcessMemory ou WriteProcessMemory request finished ...

Not tracing WCF Service (diagnostics tracing)

I have a client (a Unit Test) that call to WCF Service (hosting in debug mode in Console application). I have an error in service but I dont know which. I need trace it, but not generate anything file svclog in client. any suggestions , any sample code works ? EDIT: I use logging EntLibrary 4.1. I think there are errors in configurati...

C# - Running a new process as User - with OUT a password?

I have a child process I spawn from my main application that needs to be run as another local user on a Windows 7 machine. I would prefer to not set a password on that user account, but it seems that creating a new process with impersonation does not allow for blank passwords or any type of null values. Anyone know if this is possible?...

Logging in ASP.NET

Is there any logger to asp.net like the System.ServiceModel.MessageLogging used in WCF? ...

Log4net traceappender not logging anything

I'd like to redirect everything logged by log4net to the System.Diagnostics Trace classes. My understanding of what I should be doing is pointing log4net at system.diagnostics.traceappender, then I configure system.diagnostics. Here's important parts in my web.config: <log4net> <appender name="trace" type="log4net.Appender.TraceAppender...

Logging and WCF

I have seen many other questions on logging. Best practices. What logging platform is best. Etc. Here are some links from here on SO with very good discussions on the topic: logging best practices log4net vs TraceSource best logging solution for .NET 3.5 project .NET 3.5 logging BEGIN EDIT: Having typed this long post, I guess t...

Process.Start dirquota.exe - The system cannot find the file specified

Hi, Banging my head against the wall for around 2 days with this one. I am using a System.Diagnostics.Process to execute dirquota.exe. I catch an exception at .Start() which is "The system cannot find the file specified". I am now doing: foreach (var fi in new DirectoryInfo(@"C:\Windows\System32\").GetFiles()) ...

When using System.Diagnostic Process, will I miss some output lines between the start of process and start of capturing output?

If I have code such as proc.Start(); string resultOut; while ( (!proc.HasExited && (resultOut = stdOut.ReadLine()) != null)) { // Do some operation based on resultOut } Am I liable to miss some lines from when I start proc to when the capturing/parsing begins or will it wait? If it doesn't what can I do? ...

WCF and IIS error 500 when using diagnostics

I have problem with WCF on IIS when using diagnostics. When I call the service I get the following error: System.Net.WebException: The remote server returned an error: (500) Internal Server Error.. If I remove "system.diagnostics" section I dont get error 500 but I get an error The requested service, 'http://localhost/Cu...

difference between Debugger.Launch to Debugger.Break

what's the difference between Debugger.Launch(); Debugger.Break(); ? ...

Output controller Dianostics.Trace statements to a view page?

In Web Forms we were able to see out N-Tier System.Diagnostics trace statements at the bottom of a page because they effectively executed within the page lifecycle. In Mvc, I can find these trace statements using trace.axd and randomly searching the index, but I would really like my trace statements that execute inside my controller act...

Running a program with System.Diagnostics.Process.Start causes an Application Error

On my PC DWG files open with: "C:\Program Files\AutoCAD LT 2007\acadlt.exe" "%1" If I run this from the command line: "C:\Program Files\AutoCAD LT 2007\acadlt.exe" "C:\Some Path\Test.dwg" AutoCAD Lite open the DWG file. Similarly if I open a command prompt and run the same exe with argument, it works fine. However if I use var ...

How to interrupt an IO bound thread.

I am opening a System.Diagnostic.Process to read the stdout from a process and I would like to be able to interrupt it after a certain elapsed time. try { output = outputStream.ReadToEnd(); } catch (ThreadInterruptedException e) { return; } That doesn't work since the thread is in the ReadToEnd() method. I attempted to close t...

Problem launching a System.Diagnostics.Process under Windows 7

I’m trying to launch an application (Operating System, My Application and the application I want to launch are all 32 bits), from .NET 3.51. The code that launches the Process is used for other applications, but there’s one that is giving us a headache. If we “double click” on the application’s icon, it works as expected, meaning that i...