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 6356115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:54:06+00:00 2026-05-24T22:54:06+00:00

I find some good post on F#/WPF programming, but it doesn’t seem to teach

  • 0

I find some good post on F#/WPF programming, but it doesn’t seem to teach a way to compile/build the code to make binary out of F#/WPF.

What command/tool do I use to build/compile this code into execution binary? Just running fsc or fsi doesn’t seem to work.

#light 
#I @"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0"
#r @"WindowsBase.dll"
#r @"PresentationCore.dll"
#r @"PresentationFramework.dll"

open System
open System.Windows

(* From Chap 1 - SayHello.cs *)

let win = new Window()
win.Title <- "Say Hello"
win.Show()

#if COMPILED
[<STAThread()>]
do
     let app =  new Application() in    
     app.Run() |> ignore
#endif
  • 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-24T22:54:08+00:00Added an answer on May 24, 2026 at 10:54 pm

    If you want to compile the code using fsc then you’ll need to remove the #I and #r commands and use a compiler command line arguments instead. The #light command is not required anymore, so you can just delete first 5 lines. In addition to the #r references, I also had to add System.Xaml.dll (which is probably new in .NET 4)

    Then you can compile it using something like:

    fsc.exe -r:WindowsBase.dll -r:PresentationCore.dll -r:System.Xaml.dll
            -r:PresentationFramework.dll --target:winexe Main.fs
    

    Running the code in fsi.exe should work just fine (after adding #r "System.Xaml.dll"). Just copy the code and paste it to the F# Interactive (running either in console or in Visual Studio IDE).

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

Sidebar

Related Questions

Maybe the solution is obvious, but I cant seem to find a good one.
So, I searched some here, but couldn't find anything good, apologies if my search-fu
I had some problems figuring out a good title, but hopefully the code examples
Where can I find some good pointers on best practices for running ASP.NET MVC
Were can I find some good Podcasts that talk about program with Delphi &
Where can I find some good documentation on data/element binding? My Google searches haven't
Where to find good material to study observer pattern? I need some examples, of
Question related to HABTM has been posted in some good numbers on stackoverflow but
I have a few things that I cannot find a good way to perform
Yet another multi tenancy post im afraid. I just cant find a good solution

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.