我已经有一段时间这个问题了,但是我很久没有使用Visual Studio了。但是现在我只想解决这个问题。
我正在学校学习F#课程,并且尝试跟着我的老师进行编码课程。这是代码
module Program
open System
let incr =
fun x ->
x + 1
[<EntryPoint>]
let main argv =
let res = incr 5
printfn "My result is %d and I print a random number %d" res 5
0
当我按F5键或按Start键时,该窗口会迅速弹出,没有显示任何输出,并立即关闭。我正在阅读您必须禁用的其他类似帖子
tools>options>debugging>Automatically close the console when debugging stops
但是它已经被取消选中,然后我得知您必须设置“子系统来控制”,但是我试图进行查找,但是我找不到任何可以理解的东西。
我只是想做我的作业,我真的很想解决这个问题,所以我可以再次开始使用Visual Studio。
使用ReadLine
或ReadKey
,就像您可能在C中使用getch
一样。
[<EntryPoint>]
let main argv =
printfn "Hit return to close"
Console.ReadLine() |> ignore
0 // return an integer exit code