草庐IT

specify-an-init-process

全部标签

c# - 内存溢出 : Having an increasing number of Microsoft. CSharp.RuntimeBinder.Semantics

我们目前正在我们的应用程序中寻找一些内存泄漏,当执行一些操作(在我们的应用程序中加载和关闭一个项目)时,我们知道内存总是增加一点点。我们已经找到了很多,但现在,增加最多的10个类是(根据我们的工具ANTSMemoryProfiler8.2):Microsoft.CSharp.RuntimeBinder.Semantics.SYMTBL+KeyMicrosoft.CSharp.RuntimeBinder.Semantics.LocalVariableSymbolMicrosoft.CSharp.RuntimeBinder.Semantics.CONSTVALMicrosoft.CShar

c# - 犀牛模拟 : How to stub a generic method to catch an anonymous type?

我们需要stub一个通用方法,该方法将使用匿名类型作为类型参数来调用。考虑:interfaceIProgressReporter{TReport(TprogressUpdater);}//Unittestarrange:FuncreturnArg=(x=>x);//wewishtoreturntheargument_reporter.Stub(x=>x.Report(null).IgnoreArguments().Do(returnArg);如果在被测方法中对.Report()的实际调用是使用对象作为类型参数完成的,那么这将起作用,但实际上,调用该方法时使用的T是匿名类型。此类型在被测

c# - Process.Start() 启动的应用程序未获取参数

使用C#,我尝试使用Process.Start()将命令行参数传递给新进程:stringpath=@"C:\Demo\Demo.exe";stringarguments="onetwothree";ProcessStartInfostartInfo=newProcessStartInfo{FileName=path,Arguments=arguments};varprocess=Process.Start(startInfo);我的C应用程序Demo.exe只是回显命令行参数:intmain(intargc,char*argv[]){intcount=0;//Displayeachco

c# - Process.Start() 比在控制台中执行慢得多

我在使用Process.Start()执行.exe时遇到性能问题。.NET的执行时间大约是控制台的5倍。什么会导致这个?这是一个测试程序:publicstaticvoidMain(string[]argv){for(inti=0;i结果是这样的:0Elapsedtime4310ms.1Elapsedtime4330ms.2Elapsedtime4280ms....在cmd窗口中运行它几乎立即返回(不到1秒的执行时间)。尝试使用在控制台中对其进行计时>powershellMeasure-Command{cmd/cstart/wait%EXE%%ARGS%}执行时间大约为750毫秒,快了5

c# - 错误 : ExecuteReader requires an open and available Connection. 连接的当前状态为打开

我有下面带有DataHelperClass的mvc4网站来执行查询。我的问题有时是,网站以异常为标题。我使用block来处理SqlCommand和SqlDataAdapter但没有成功。请帮助我,对不起我的英语。try{if(_conn.State==ConnectionState.Closed)_conn.Open();using(SqlCommandsqlCommand=newSqlCommand(query,_conn)){sqlCommand.CommandType=CommandType.StoredProcedure;if(parameters!=null)sqlComma

c# - XSD 工具在生成 C# 代码时将 "Specified"附加到某些属性/字段

我无法真正解释XSD生成器的奇怪行为。我有一个像这样的XSD:SomeDoc............它派生自CoreObject:...这只是XSD的一小部分,还有很多更复杂的类型。所以当我生成类似于this的类时,我得到一个生成的类,它有两个属性(除了我期望的5个属性):publicboolMinDuration_100msSpecified和publicboolStageOnDemandSpecified因此“原始”属性被附加了“Specified”,类型现在是bool。谁能解释为什么会这样? 最佳答案 bool属性表示相关属性

c# - 如何在没有 "process has exited"异常的情况下终止进程?

我使用Process.Kill()来终止进程。像这样:if(!process.WaitForExit(5000)){process.Kill();}有时进程会在两行之间退出,所以控制会进入if然后Kill会产生异常:System.InvalidOperationExceptionCannotprocessrequestbecausetheprocess(ProcessIdHere)hasexited.atSystem.Diagnostics.Process.GetProcessHandle(Int32access,BooleanthrowIfExited)atSystem.Diagno

c# - "Both use the XML type name X, use XML attributes to specify a unique XML name and/or namespace for the type"怎么解决?

我有以下枚举定义...namespaceItemTable{publicenumDisplayMode{Tiles,Default}}namespaceEffectiveItemPermissionTable{publicenumDisplayMode{Tree,FullPaths}}...然后我有以下类(class)...publicclassTablewhereTDisplayMode:struct{//publicpublicTDisplayModeDisplayMode{get{returnmDisplayMode;}set{mDisplayMode=value;}}//pri

c# - LINQ 到 XML : applying an XPath

有人能告诉我为什么这个程序不枚举任何项目吗?它与RDFnamespace有关吗?usingSystem;usingSystem.Xml.Linq;usingSystem.Xml.XPath;classProgram{staticvoidMain(string[]args){vardoc=XDocument.Load("http://seattle.craigslist.org/sof/index.rss");foreach(varitemindoc.XPathSelectElements("//item")){Console.WriteLine(item.Element("link")

c# - Process.Start() 从命令提示符窗口获取错误

我正在尝试使用参数启动命令提示进程。现在我想获取有关错误的信息(如果存在)。someProcess=System.Diagnostics.Process.Start(cmd,someArgs);最好的问候,洛维吉 最佳答案 其他答案都是正确的。这是您可以使用的一些代码:ProcessStartInfostartInfo=newProcessStartInfo(cmd,args);startInfo.UseShellExecute=false;startInfo.RedirectStandardError=true;Processso