471,321 Members | 1,768 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,321 software developers and data experts.

dynamically compiled c# code - is it debuggable in 2.0?

Does anyone know off hand if dynamically compiled C# is debuggable in
..net 2.0?
Nov 28 '05 #1
3 1772
Benny,

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).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Benny Raymond" <be***@pocketrocks.com> wrote in message
news:ut*************@TK2MSFTNGP11.phx.gbl...
Does anyone know off hand if dynamically compiled C# is debuggable in .net
2.0?

Nov 28 '05 #2
> Does anyone know off hand if dynamically compiled C# is debuggable in
.net 2.0?

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.

Anders Norås
http://dotnetjunkies.com/weblog/anoras/
Nov 28 '05 #3
On Mon, 28 Nov 2005 15:57:02 -0500, Benny Raymond
<be***@pocketrocks.com> wrote:
Does anyone know off hand if dynamically compiled C# is debuggable in
.net 2.0?


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:

CompilerParameters param = new CompilerParameters();
param.GenerateInMemory = false;
param.IncludeDebugInformation = true;
param.OutputAssembly = "C:\Temp\blah.dll";

I haven't tried yet if Visual Studio 2005 can debug code that was
dynamically compiled in-memory.
--
http://www.kynosarges.de
Nov 29 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Thomas W. Brown | last post: by
2 posts views Thread by Eric | last post: by
2 posts views Thread by Ed Leafe | last post: by
9 posts views Thread by netasp | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.