title: How to debug/break in codedom compiled code
body: <p>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 into the dynamic assembly? Obviously setting breakpoints is problematic, since the source is not part of the original project, but should I be able to step into, or break on exceptions for the code?</p>
  
  <p>Is there a way to get codedom to generate PDBs for this or something?</p>
  
  <p>Here is the code I am using for dynamic compliation.</p>
  
  <pre><code>CSharpCodeProvider codeProvider = new CSharpCodeProvider(new Dictionary&lt;string, string&gt;() { { "CompilerVersion", "v3.5" } });
  //codeProvider.
  ICodeCompiler icc = codeProvider.CreateCompiler();
  
  CompilerParameters parameters = new CompilerParameters();
  parameters.GenerateExecutable = false;
  parameters.GenerateInMemory = true;
  parameters.CompilerOptions = string.Format("/lib:\"{0}\"", Application.StartupPath);
  parameters.ReferencedAssemblies.Add("System.dll");
  parameters.ReferencedAssemblies.Add("System.Core.dll");
  
  
  CompilerResults results = icc.CompileAssemblyFromSource(parameters, Source);
  DLL.CreateInstance(t.FullName, false, BindingFlags.Default, null, new object[] { engine }, null, null);
  </code></pre>