This would depend on where you are getting the code from. The IDE would
have to be able to find the code file somehow. If you were getting it from
a database or something of that nature, I don't think that it would work
(very little would, actually).
You can allways debug a dissassembly of the code, but when it comes to debugger
symbols it depends. If you generate the code with the CodeDOM or use a string
based template, and compile with an ICompiler implementation, you can set
the IncludeDebugInformation on the CompilerParameters argument passed to
the ICodeCompiler's compile methods to generate a PDB-file.
If you're using Reflection.Emit, you're generating IL code on the fly, and
hence you haven't got any source code to generate debugging symbols for.
With Visual Studio 2002/2003, you could debug a dynamically compiled
C# file within the IDE as long as you wrote the DLL & PDB data to
physical files, like so:
I haven't tried yet if Visual Studio 2005 can debug code that was
dynamically compiled in-memory.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.