Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 939387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:46:55+00:00 2026-05-15T21:46:55+00:00

While debugging an F# application, I would like to be able to invoke an

  • 0

While debugging an F# application, I would like to be able to invoke an F# method from the VS2010 immediate window but it doesn’t seem to work. The problem appears to be that F# methods are actually FSharpFunc objects. I tried using the “Invoke” method but the interactive window doesn’t recognize it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:46:56+00:00Added an answer on May 15, 2026 at 9:46 pm

    The F# integration for Visual Studio doesn’t support F# expressions in immediate window (or watches), so the only option is to write C# code corresponding to the compiled representation that F# uses. I tried doing that and I’m having the same issue as you described – the Invoke method appears to be there (in Reflector), but Visual Studio doesn’t want to call it directly. I tried it using the following example:

    let foo f = 
      let n = f 1 2 // Breakpoint here
      n + 1
    

    However, there are other ways to call the function. In this case, the actual code generated by the F# compiler is a call to InvokeFast method. If you type the following to the immediate window, it works:

    Microsoft.FSharp.Core.FSharpFunc<int, int>.InvokeFast<int>(f, 1, 2)  |
    

    It also appears that you can call the usual Invoke method using dynamic from C# 4.0 (proving that the method is actually there!):

    ((dynamic)f).Invoke(1, 2)
    

    This works only if you add reference to Microsoft.CSharp.dll (and use some type defined in the assembly somewhere in your code – e.g. as an annotation – so that it gets loaded).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 457k
  • Answers 457k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I like the second proposed solution (the intermediate layer), as… May 15, 2026 at 10:47 pm
  • Editorial Team
    Editorial Team added an answer Have you tried making sure the dispatcher is idle before… May 15, 2026 at 10:47 pm
  • Editorial Team
    Editorial Team added an answer Title isn't an attribute, it's another tag within item. May 15, 2026 at 10:47 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.