How do you debug a .NET (C#) conversion script?
I have followed the tutorial to create a post converter script, from here:- https://developers.coveo.com/display/public/SC201506/Displaying+External+Content+in+a+Search+Interface
In the tutorial a script file is referenced as a plain .cs file.
I now want to be able to attach a debugger in my code so I can step through it and check out some info. I've found this question:- https://answers.coveo.com/questions/330/cant-debug-net-conversion-script-ces-7
It gave a little idea about how attaching the debugger, but I couldn't find anything listing all the steps involved. I assume I need to point the converter to my DLL, which will be alongside my PDB file.
I've tried setting:-
Configuration -> Converters -> Conversion Scripts -> Script File
to the DLL in my Class Library project's /bin/Debug folder.
Configuration -> Converters -> Conversion Scripts -> Type Name
to the fully qualified 'namespace.class, assembly' value.
I then save it all, attach my debugger to the CESConverter7.exe process (under Managed mode), and then rebuild the source from the CES Admin tool.
The symbols don't get loaded, and so no breakpoints will ever be hit.
Can anyone tell me what I am missing?
I worked out that:-
- the Script File needs to point to the DLL in the /Debug folder of my project
- the c# class library project needs to have a Target Framework of .NET 3.5
- When debugging, you need to select 'Managed (v3.5, v3.0, v2.0) code'. - Thanks @sdesilets for the tip
I've detailed the full setup in my blog post, here:- http://www.seanholmesby.com/debugging-a-custom-coveo-conversion-script/
Make sure your conversion assembly targets v3.5, v3.0 or v2.0 of the .Net framework.
The CESConverter7 process uses the CLR v2.0.
Attach to CESConverter7.exe in "Managed (v3.5, v3.0, v2.0) code".