是否有可能混合的.cs(C#)和.FS(F#)的文件在一个单一的Visual Studio中的Windows控制台项目? (。净) [英] Is it possible to mix .cs (C#) and .fs (F#) files in a single Visual Studio Windows Console Project? (.NET)

查看:209
本文介绍了是否有可能混合的.cs(C#)和.FS(F#)的文件在一个单一的Visual Studio中的Windows控制台项目? (。净)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

怎么办呢? 是否有可能调用从一个F#code到C#的函数,而无需使用分离的DLL文件或项目?

How to do it? Is it possible to call a function from one F# code into C# without using a separated dll file or project?

推荐答案

您不能包含在同一个项目中的两个不同的语言,但你可以用它们的ilmerge 。要做到这一点,就把这两个项目在同一个解决方案,并引用F#模块,就像任何DLL。作为部署脚本的一部分,运行ilmerge的exe文件和dll文件合并成一个单一的exe文件。见文章,详细介绍了如何使用ilmerge创建一个exe这个 code项目。

You can't include two different languages in the same project, but you can merge them using ilmerge. To do this, put both projects in the same solution and reference the F# module as you would any dll. As part of your deployment script, run ilmerge to combine the exe file and dll file into a single exe file. See this Code Project article that details how to use ilmerge to create an exe.

这篇关于是否有可能混合的.cs(C#)和.FS(F#)的文件在一个单一的Visual Studio中的Windows控制台项目? (。净)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆