How to tell Rider Assembly Location

I'm trying to debug some code generated by the XMLSerializer class. I set the /system.diagnostics/switches/add[@name="XmlSerialization.Compilation"] value so that the assembly and corresponding PDB are written to disk. This results in one or more Microsoft.GeneratedCode.dll assemblies being created (depending on how many different timess its registered). I've made a copy of the assembly I want to debug into, but how do I tell Rider the assembly's location?

Thanks!

3 comments
Comment actions Permalink

Hi Kpederson!

Could you please explain your case in more detail?  

In Rider, there is an external source debugging feature that could be useful in your case. 

0
Comment actions Permalink

When my application runs it makes a number of calls to `new XmlSerializer(type, (new List<Type>() {...}).ToArray()))`. At the time one of these serializer instances is first used, a new assembly is dynamically created and loaded called "Microsoft.GeneratedCode.dll". When the `/system.diagnostics/switches/add[@name="XmlSerialization.Compilation"]` switch is set, its equivalent assembly and PDB are also created on disk. Note also that the assembly will be overwritten the next time a different instance of the XmlSerializer is used for the first time, so its lifespan is sometimes short lived.

While running the application in the debugger, I would like Rider to do a number of things that I'm not sure are possible yet:

  1. Step into the dynamically generated method on the XmlSerializer instance
  2. Decompile the dynamically generated code behind the XmlSerializer classes
  3. Allow me to specify the physical location on-disk where assembly and corresponding PDB are when they correspond to an assembly that has been loaded into memory so that I can debug the dynamically generated code as if it were a regular on-disk assembly.

I found issue RIDER-24566, which I believe implies that the first two are not possible at this time. I am hoping option number 3 is possible somehow.

Please let me know if you need any additional clarification.

0
Comment actions Permalink

Hi! 

The first two points indeed are not implemented and related to RIDER-24566

The last one is also not possible, unfortunately. Here is the feature request for this: RIDER-18260.

Feel free to follow them and vote to be notified about updates. 

 

0

Please sign in to leave a comment.