是否可以将Razor用作OSX上的独立库(不涉及任何asp.net业务)(通过Mono) [英] Is it possible to use Razor as a standalone library (without any asp.net business) on OSX (via Mono)
问题描述
我想写一个概念证明 MonoMac 应用程序,该应用程序使用c#和Razor.
I would like to write a proof of concept MonoMac app which renders html "Views" using c# and Razor.
这可能吗?
如果没有,是否有人会推荐其他任何与Razor的简单性相比的模板引擎.如果需要的话,我不介意用Objective-C编写它,但是Mono会更简单.
If not, does anyone recommend any other Templating engines that compare to the simplicity of Razor. I don't mind writing it in Objective-C if I have to, but Mono would be simpler.
推荐答案
我认为您可能对此项目.您只需要下载包含两个DLL的zip,在您的项目和示例中引用它们,例如这些可以正常工作.请记住,您必须进行4.0项目.我已经在Mono 2.10.5上进行了测试,但是OS是Linux,而不是OS X,因为我没有.尽管如此,这不应该是一个问题.
I think you may be interested in this project. You just have to download zip which consists of two DLLs, reference them in your project and examples like these just works. Have in mind that you have to make 4.0 project. I have been testing this on Mono 2.10.5, however OS was Linux, not OS X, because I don't have one. It shouldn't be a problem nevertheless.
Another approach is to do something like mentioned here. Post is quite old and libraries' names has changed but you should be able to use one which are downloadable here. The first approach is cleaner, however I am not sure if it is what you need.
You can also find this project interesting.
这篇关于是否可以将Razor用作OSX上的独立库(不涉及任何asp.net业务)(通过Mono)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!