How to debug/break in codedom compiled code

后端 未结 2 1766
醉话见心
醉话见心 2020-12-09 09:24

I have an application which loads up c# source files dynamically and runs them as plugins. When I am running the main application in debug mode, is it possible to debug int

2条回答
  •  时光说笑
    2020-12-09 09:52

    Try the following options:

    parameters.GenerateInMemory = false; //default
    parameters.TempFiles = new TempFileCollection(Environment.GetEnvironmentVariable("TEMP"), true);
    parameters.IncludeDebugInformation = true;
    

    I am not sure if this works OK in your case, but if it does, you can surround this parameters with conditional compilation directive, so that it dumps the generated assembly only in debug mode.

提交回复
热议问题