我将尝试将一个简单的f#控制台应用程序部署到同事的计算机上,但它一直失败。双击应用程序图标后,控制台窗口出现,但随后Microsoft错误报告窗口出现,询问是否要发送错误报告,我拒绝,然后控制台窗口中闪现一些文本。它看起来像是一个错误消息,但窗口关闭得太快了,无法确定。奇怪的是,如果我创建一个类似的C#应用程序,它就可以工作。我正在以发布模式针对.net 4客户端框架进行目标设置。
以下是代码:
f#代码(不起作用):
以下是代码:
f#代码(不起作用):
open System
printfn "print test"
Console.ReadLine() |> ignore
c# 代码(可运行):
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TestCApplication
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Testing...");
Console.ReadLine();
}
}
}