Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Experts*
Posted

I have a class that implements an Interface, and a Windows app

that compiles the code file at runtime and loads it into a class

instance. In this way, I can change the code while the app is

running.

 

The only downside is that conventional VS.NET debugging

techniques do not work; I can't step through the code, check

variable values, etc. The only method I have to debug at the

moment is a Debug event that I raise whenver I want to return

the value of a variable, but the debugging is very frustrating.

 

How can I have a dynamically-compiled and loaded DLL and still

be able to debug it "normally"? Or maybe there's an easier method of

debugging?

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

  • *Gurus*
Posted

The only way you could get started with this is if you're compiling from a file on disk (you may well be, I don't know) and then loading the assembly dynamically from the compiled version (also on disk). That way, the debugging symbols will be present and point to a valid source file.

 

That ought to be enough for the debugger you're running under to catch the exception and find source code for it.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

  • *Experts*
Posted

I see what you mean, but how will VS.NET know when to start

debugging the code? When I set a breakpoint in the code, the

red circle has a little question mark and it says that no symbols

are loaded.

 

Also, the code and compiled DLLs both on the local HD.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...