【问题标题】:How to make NHaml work with Asp.net MVC 6如何使 NHaml 与 Asp.net MVC 6 一起使用
【发布时间】:2015-06-19 09:59:27
【问题描述】:

我正在尝试在我的 asp.net MVC 6 项目中使用 NHaml 作为 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 的经验非常有限,这个问题可能令人困惑。

【问题讨论】:

    标签: asp.net .net asp.net-mvc nhaml


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-10
      • 2023-03-13
      • 2015-05-31
      • 1970-01-01
      • 1970-01-01
      • 2012-06-18
      • 1970-01-01
      相关资源
      最近更新 更多