使用 F# 将通配符文件包含在 .NET Core 项目中

Wildcard file include in .NET Core project with F#

我正在使用 aspnet Yeoman 模板尝试 ASP.NET Core with F#,我在 project.json:

中发现了一些我没有预料到的东西
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true,
"debugType": "portable",
"compilerName": "fsc",
"compile": {
  "includeFiles": [
    "Controllers.fs",
    "Startup.fs",
    "Program.fs"
  ]
}

如果我移动任何现有文件,我会收到构建错误。如果我将 includeFiles 属性 更改为值为 *.fs 的单个字符串,我会收到以下消息:

The 'includeFiles' property cannot contain wildcard characters.

dotnet CLI 中的 F# 项目模板也在其 project.json 中包含此结构。

必须手动将每个文件添加到 project.json 似乎是将 F# 与 .NET Core 结合使用的一个很大的生产力障碍。目前有什么解决办法吗?

在 F# 中,您必须明确定义编译源文件的顺序。

因此 通配符 在任何 F# 构建系统中都没有意义。

关于 Organizing modules and files

的好博客 post