system.diagnostics

Performance impact of DefaultTraceListener

瘦欲@ 提交于 2021-02-18 10:58:47
问题 When using System.Diagnostics tracing, is there a significant (measurable) performance impact on not removing the "Default" trace listener on a production ASP.NET application in release mode, with the TRACE constant defined at compilation time but with no debugger attached at runtime? To clarify, the question is about additional impact of the "Default" trace listener on an application that is using other trace listeners, not about alternatives to System.Diagnostics tracing. Are there any

Calling dism.exe from System.Diagnostics.Process Fails

爷,独闯天下 提交于 2020-02-11 13:25:46
问题 For enabling Microsoft-Hyper-V and Microsoft-Hyper-V-Management in Windows 2008 R2 Server(64bit), I'm calling dism.exe as a process. The command I've used is Dism.exe /online /Get-FeatureInfo /FeatureName:Microsoft-Hyper-V Dism.exe /online /Get-FeatureInfo /FeatureName:Microsoft-Hyper-V-Management-Clients This works fine when I execute this from the command line but it fails when I try to execute it through my code. I've tried the 64bit version of Dism.exe under the C:\Windows\SysWoW64 folder

Calling dism.exe from System.Diagnostics.Process Fails

佐手、 提交于 2020-02-11 13:21:38
问题 For enabling Microsoft-Hyper-V and Microsoft-Hyper-V-Management in Windows 2008 R2 Server(64bit), I'm calling dism.exe as a process. The command I've used is Dism.exe /online /Get-FeatureInfo /FeatureName:Microsoft-Hyper-V Dism.exe /online /Get-FeatureInfo /FeatureName:Microsoft-Hyper-V-Management-Clients This works fine when I execute this from the command line but it fails when I try to execute it through my code. I've tried the 64bit version of Dism.exe under the C:\Windows\SysWoW64 folder

Calling dism.exe from System.Diagnostics.Process Fails

你说的曾经没有我的故事 提交于 2020-02-11 13:19:43
问题 For enabling Microsoft-Hyper-V and Microsoft-Hyper-V-Management in Windows 2008 R2 Server(64bit), I'm calling dism.exe as a process. The command I've used is Dism.exe /online /Get-FeatureInfo /FeatureName:Microsoft-Hyper-V Dism.exe /online /Get-FeatureInfo /FeatureName:Microsoft-Hyper-V-Management-Clients This works fine when I execute this from the command line but it fails when I try to execute it through my code. I've tried the 64bit version of Dism.exe under the C:\Windows\SysWoW64 folder

How to run multiple lines in cmd as administrator using C#?

大城市里の小女人 提交于 2020-01-25 13:12:08
问题 Is there a work around or a function that lets me run multiple commands in one elevated command prompt? I tried setting UseShellExecute=false and use StreamWriter, but I read that if I do that, I can't use an elevated command prompt. If I set UseShellExecute=true, I can use the elevate cmd but I need to use process.Argument() which only lets me run one command in one cmd process at a time. I have a loop that runs one command at a time in different cmd process and it works. But it just gets

Process.StandardInput.WriteLine Not working on Java.exe

◇◆丶佛笑我妖孽 提交于 2020-01-14 06:10:10
问题 I'm having an issue with the following code: private void Form1_Load(object sender, EventArgs e) { cmdOutput = new StringBuilder(""); cmdProcess = new Process(); cmdProcess.StartInfo.WorkingDirectory = @"C:\android-sdk\tools"; cmdProcess.StartInfo.FileName = @"java"; cmdProcess.StartInfo.Arguments = @"-Xmx512m -Djava.ext.dirs=lib\;lib\x86_64 -Dcom.android.monkeyrunner.bindir=..\framework -jar lib\monkeyrunner.jar"; cmdProcess.StartInfo.UseShellExecute = false; cmdProcess.StartInfo

log4net became very slow with caller location information after Windows 10 Fall Creators Update (1709)

杀马特。学长 韩版系。学妹 提交于 2020-01-13 13:06:13
问题 I known that the documentation of log4net points out that the logging of caller location information can be very slow and shouldn't be used unless the performance of the software is not affected. And until the Windows 10 Fall Creators Update this was the case. Here is a small example project. app.config <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net" /> </configSections> <log4net>

Read Process StandardOutput before New Line Received

断了今生、忘了曾经 提交于 2020-01-09 11:47:49
问题 I'm trying to do something that appears to be out of scope for the System.Diagnostics.Process object. Acceptable answers can propose a different approach as long as it uses .net 4.5/c#5. My program is calling gdalwarp.exe to perform a long running processes on large tiff files. Galwarp.exe outputs in this format. Creating output file that is 6014P x 4988L. Processing input file [FileName].tiff. Using band 4 of source image as alpha. Using band 4 of destination image as alpha. 0...10...20...30

Read Process StandardOutput before New Line Received

我的梦境 提交于 2020-01-09 11:47:09
问题 I'm trying to do something that appears to be out of scope for the System.Diagnostics.Process object. Acceptable answers can propose a different approach as long as it uses .net 4.5/c#5. My program is calling gdalwarp.exe to perform a long running processes on large tiff files. Galwarp.exe outputs in this format. Creating output file that is 6014P x 4988L. Processing input file [FileName].tiff. Using band 4 of source image as alpha. Using band 4 of destination image as alpha. 0...10...20...30

Monitoring Process Exits in a Custom Action

孤街醉人 提交于 2020-01-06 10:54:31
问题 All – I need to carry out several tasks silently via Custom Actions. Essentially, I need to install and license a 3rd party application after I've laid down my own bits: I install my bits into the Application Folder I launch a custom action to Install the 3rd party app via FooSetup.exe I launch another custom action to license the third party app via FooLicense.exe, installed during step 2. During the Commit phase of the installer, I fire this code to launch the silent setup of the 3rd party