2

After rewriting a VB.NET assembly with Mono.Cecil the 'Call Stack' debugging window in Visual Studio 2010 shows the language as C# and not VB.NET. Is it possible configure Mono.Cecil to rewrite an assembly so the debugger recognises the rewritten assembly as VB.NET?

The following Mono.Cecil simply reads and saves an assembly without modification. However, the debugger reads the new assembly as C# instead of VB.NET.

Dim readerParameters = New ReaderParameters() With {.ReadSymbols = True}
Dim writerParameters = New WriterParameters() With {.WriteSymbols = True}

Dim appToRewrite = AssemblyDefinition.ReadAssembly(
    appToRewriteExe, 
    readerParameters
)

appToRewrite.Write(appToRewriteExe, writerParameters)

It is desirable for the rewritten assembly to be VB.NET so the debugging windows 'Local' and 'Immediate Window' are the VB.NET versions rather than the C# versions.

Tim Murphy
  • 4,892
  • 4
  • 40
  • 48

1 Answers1

1

Thank you for filing this bug! Oh wait, this is SO.

Anyway, that definitely looks like a bug.

I've filed it as https://github.com/jbevain/cecil/issues/81, StackOverflow being a not so great bug tracker.

Jb Evain
  • 17,319
  • 2
  • 67
  • 67
  • Thanks Jb. I would have filed it as a bug if I was sure that was what it was :-) – Tim Murphy Oct 28 '11 at 06:11
  • Sure :) For the record, this has been fixed by updating the copy of the managed PdbReader that Cecil borrows from the CCI, and support for detecting FSharp has been added as well. Thanks! – Jb Evain Oct 28 '11 at 08:22