Keith Harrison
Keith Harrison

Reputation: 1586

F# Performance Profiler Instrumentation Not Working

I have a Visual Studio project that contains a C# windows application which references an F# class. When I run the Visual Studio 2010 performance profiler in instrumentation mode I get no instrumentation information for the F# class other than where it was called by the C# application.

When I run in sampling mode it works fine.

I’ve tried running the project in VS2012 and get the same issue.

How do I get Visual Studio to show the instrumentation info for the F# class?

Upvotes: 5

Views: 394

Answers (1)

Jack P.
Jack P.

Reputation: 11525

When you run in instrumentation mode, the profiler injects a bit of code at the entry/exit points of every method to record the performance data; however, it only injects this profiling code into the assembly you're actually profiling (e.g., your C# application) and not any of the referenced assemblies.

So, you need to profile the F# assembly directly. I'll assume it's a library, in which case you need to specify your C# application as the start program -- so the profiler will start the C# app but will actually instrument and profile the F# library. See the MSDN article How to: Specify the Binary to Start for the settings to do this.

Upvotes: 4

Related Questions