繁体   English   中英

如何使NHaml与Asp.net MVC 6一起使用

[英]How to make NHaml work with Asp.net MVC 6

我正在尝试将NHaml用作asp.net MVC 6项目中的ViewEngine。 我正在通过Mono在OSX系统上运行此项目。 NHaml文档https://code.google.com/p/nhaml/wiki/Configuration说要使用.xml配置文件。 但看起来MVC 6不再支持xml配置

'IConfigurationSourceRoot' does not contain a definition for 'AddXmlFile' 
and no extension method 'AddXmlFile' accepting a first argument 
of type 'IConfigurationSourceRoot' could be found
(are you missing a using directive or an assembly reference?)

我如何才能将此配置转换为json语法,或者只是简单地在代码中进行配置? 由于我对.net的经验非常有限,因此这个问题可能令人困惑。

好吧,我仍然没有让它运行,但是我想我向前迈了一步,因为我知道如何使AddXmlFile()再次工作,并将此行添加到project.json:

 "Microsoft.Framework.ConfigurationModel.Xml": "1.0.0-beta4",

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM