简体   繁体   中英

How to make NHaml work with Asp.net MVC 6

I'm trying to use NHaml as the ViewEngine in my asp.net MVC 6 Project. I'm running this project on my OSX system via Mono. The NHaml documentation https://code.google.com/p/nhaml/wiki/Configuration says to use a .xml config file. But it looks like MVC 6 doesn't support xml config any more

'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?)

How can I transfer this config to json syntax or just simply make this config right in code? This question maybe confusing, due to my very limited experience with .net.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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