内部异常:
{"Unable to locate view 'home'\r\nCurrently available view engine extensions: cshtml,vbhtml,sshtml,html,htm\r\nLocations inspected: ,,,,,,,,views/Store/home-he- IL,views/Store/home,Store/home-he-IL,Store/home,views/home-he-IL,views/home,home-he-IL,home\r\nRoot path: "}
测试代码:
[TestFixture]
public class Class1
{
[Test]
public void Spike()
{
// Given
var foo = typeof (RazorViewEngine);
var bar = typeof (SuperSimpleViewEngine);
var bootstrapper = new Bootstrapper();
var browser = new Browser(bootstrapper);
// When
var result = browser.Get("/mytest", with =>
{
with.HttpRequest();
});
// Then
Assert.AreEqual(HttpStatusCode.OK, result.StatusCode);
}
}
模块如下所示:
public class YonatanModule : NancyModule
{
public YonatanModule()
{
Get["/mytest"] = o =>
{
return View["home"];
};
}
}
我试图Nancy.ViewEngines.Razor
根据this和this添加对 的引用。
我正在使用带有 Razor 的 Nancy 0.16.1(尽管我正在尝试使用干净的 html 页面进行第一次测试)。
另外,我使用的是 Azure,但在这种情况下,我不运行模拟器或任何东西。