RE: debugging dynamic code



Hi,

You can attach referenced code that you have written to a running process
and then debug your code when it is called (assuming you have the source
code); your reply here implies that perhaps you do.

The process is described here
http://msdn2.microsoft.com/en-us/library/c6wf8e4z.aspx

You can attach to multiple processes at once if required. I guess it all
depends on how you are referencing your dependant assemblies.

regards wibbleret
Development blog at http://wibberlet.blogspot.com

===================================================

"MoriCristian" wrote:

Gi wibbleret, thanks for your reply
I need to add dynamic "scripting" in c# to a program I made (this program is
also made in c#)
I want to open an internal editor from my program, load my source file,
compile it and debug it. All this while the other components of my program
continue running.
I hope I made myself clearer.
Do you think you can help me with this issue?

Thanks
Cristian Mori
"Wibberlet" wrote:

Hi MoriCristian,

I am not quite sure what you mean here...do you want to debug an assembly
that has been compiled to IL where you do not have the associated source code?

Debugging IL is possible but certainly not easy and there will be
compromises that you have to make because of the way sequence points are
generated. Sequence points essentially map between IL instructions and native
instructions.

Depending on the size of the assembly it may be possible for you to convert
the IL code back in to source code using a tool such as .Net reflector. If
this is not possible then you could take a look at the managed debugger
located here: http://blogs.msdn.com/jmstall/archive/2004/09/30/236281.aspx.
It is restricted to #2 of the framework and is really not recommended as a
production strength utility. I guess it depends on how desperate you are to
get into the assembly.

I hope I have understood your problem properly, please let me know if that
is not the case.

wibbleret
Development blog at http://wibberlet.blogspot.com

====================================================

"MoriCristian" wrote:

Hi.
I want to debug in an app written by me (not in vs) in step by step a
routine copiled using the microsoft.csharp.compiler.
Is there any way to do so?
Thanks
Cristian Mori
.



Relevant Pages

  • RE: Assembly reported as built without debug info - that is not true
    ... enabled or without debug information:..." ... successfully remote debug any other assembly which is not in the GAC? ... in the Modules window's loading assemblies' list, ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework)
  • Unable to debug .NET assemblies loaded by a native application
    ... I am unable to debug .NET assemblies loaded by a native application ... Ordinarily one could also debug by attaching to the application's ... The application shows up in the "Attach to external process" ...
    (microsoft.public.vsnet.debugging)
  • Re: CreateProcess Hook
    ... Assemblies are installed into the ... Force fusion to load a Debug - Version. ... key token)) is already installed into the GAC? ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Some interop Questions - C# to unmanaged DLL
    ... by the CLR loader. ... measure i added the debug directory to the windows PATH env. ... it is recommended that the LoadFrom context be avoided. ... | done by installing assemblies in the Global Assembly Cache or in the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Custom CodeAccessSecurityAttribute
    ... In the 'Modules' window make sure the debug symbols are loaded ... >> public override IPermission CreatePermission() ...
    (microsoft.public.dotnet.security)

Loading