c# - C#编译器使用CodeDomProvider的详细输出

标签 c# .net compiler-construction c#-4.0 compiler-errors

我有

CompilerResults cr = codeDomProvider.CompileAssemblyFromFile(cp, source);
//where source is an array of source file names

我想要每个文件的详细编译输出。

当前,我正在使用BackgroundWorker进行编译并发送回错误消息,但是这是在编译完成之后发生的。 (成功/有错误。)
 foreach (CompilerError ce in cr.Errors)
 {
       synchronizationContext.Send(new SendOrPostCallback((m) =>
       //pushCompilerMessage(currentWindow, msg)
             ), null);                     
 }

所有这些工作都很好,但是如何传递这些消息,使其看起来好像处于真正的详细模式下?

最佳答案

“详细”在这里没有多大意义。您真的是指“实时”吗?使用BackgroundWorker的ReportProgress方法。

关于c# - C#编译器使用CodeDomProvider的详细输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4888760/

相关文章:

c# - 使关闭按钮隐藏而不是关闭

c++ - 模板内的模板 : why "` >>' should be ` > >' within a nested template argument list"

c - AtmelStudio编译代码: How to optimize compiler

c# - 解析维基词典

c# - 计算两点之间的距离

c# - DataContractJsonSerializer DateTime 隐式时区转换

c# - 带有 ASP.NET 的 app.config API 中的 ConnectionString

c# - 在 C# 中的 RESTfull/HTTP 请求中添加 header 和发布数据

.net - 如何通过 Google AdWords API v201309 检索每日费用?

parsing - 是什么让 libadalang 与众不同?