First I need to say that my experience with Asp.net is very small, that's why this question could come of confusing in some parts.
I've first created https://code.visualstudio.com/Docs/ASPnet5 a MVC6 project via yo aspnet
. Then I've added this line to "dependencies" in project.json
"Microsoft.Framework.ConfigurationModel.Xml": "1.0.0-beta4",
"System.Web.NHaml.Mvc3": "4.0.8",
Then I've created haml.xml with this Google code content and extended the following line in the Startup.cs file:
var configuration = new Configuration()
.AddJsonFile("config.json")
.AddXmlFile("haml.xml")
.AddJsonFile($"config.{env.EnvironmentName}.json", optional: true);
this is how my controller looks like:
public class HomeController : Controller
{
public IActionResult Index()
{
return View(@"~/Views/Shared/Test.haml");
}
}
the apps starts up, but I can't render the action, this is the error that shows up in the browser
An unhandled exception occurred while processing the request.
InvalidOperationException: The view '~/Views/Shared/Test.haml' was not found. The following locations were searched: ~/Views/Shared/Test.haml. Microsoft.AspNet.Mvc.Rendering.ViewEngineResult.EnsureSuccessful () [0x00000] in , line 0
But this file does exist in this directory. Any hints or help is appreciated.
BOUNTY edit:
Basicly what I want is a detailed explanation or a working example of a very very simple MVC 5 or 6 Project that uses NHaml or any other lib that Provides Haml syntax (If it works with Mono on osx, that's a bonus). Tanks a lot!