Gravatar for

Question by sholmesby, Jun 17, 2015 5:09 PM

How do you debug a .NET (C#) conversion script?

I have followed the tutorial to create a post converter script, from here:-

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:-

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.

and set:-

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?

2 Replies
Gravatar for

Answer by sholmesby, Jun 18, 2015 10:08 AM

I worked out that:-

  1. the Script File needs to point to the DLL in the /Debug folder of my project
  2. the c# class library project needs to have a Target Framework of .NET 3.5
  3. 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:-

Gravatar for

Answer by Sebastien Desilets, Jun 17, 2015 6:21 PM

When building
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.

When debugging
Attach to CESConverter7.exe in "Managed (v3.5, v3.0, v2.0) code".

Gravatar for

Comment by sholmesby, Jun 17, 2015 10:30 PM

It was 'Managed (v4.5, v4.0) code'. Should my project be .NET 3.5 based? Have I properly setup the DLL path and Type Name?

Gravatar for

Comment by Sebastien Desilets, Jun 18, 2015 10:13 AM

Oops sorry I didn't notice the type name. No, don't specify the assembly name, only the full class name (namespace + class name).

It also helps to have the Index log opened when you rebuild or refresh the CES Source you added your conversion script to. In it you should see something like this: Rebuild on source YOURSOURCE(with conversion script YOURSCRIPTNAME) has been requested by YOU. Loading plugin 'YOURCOMPLETEDLLPATH'

or Loading plugin 'YOURCOMPLETEDLLPATH' [SERVERNAME] Error loading custom converter: Type names passed to Assembly.GetType() must not specify an assembly.

Ask a question