Search code examples
debuggingf#type-providers

how to debug a Type Provider in fsharp?


I have a COM error inside of my TypeProvider which opens an excel file.

How can I debug it ? Adding

  open System.Diagnostics
  Debug.WriteLine "toto"
  let xlApp = new Excel.ApplicationClass()

I dont know whree the message are going. Debugview does not show anything either, although I see Excel is trying to load, which happens after after my debug statements...


Solution

  • There is a detailed guide in there :

    http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-21-61-89/type_2D00_provider_2D00_authoring_2D00_fsharp_2D00_3.0_2D00_developer_2D00_preview.pdf

    Section 2.3 explain how you can attach to another devenv.exe, which uses the typeprovider in a script.

    Now it breaks on error, and you can set up breakpoints as well.