2014-09-13 57 views
3

体验这里具体描述https://github.com/NancyFx/Nancy/issues/1528Nancy.ViewEngines.ViewNotFoundException:找不到视图“index.cshtml”

的问题,即使我包括Razor视图引擎按照我的理解是正确的配置,它不永远不会工作。自托管。我的Mac(Mono/Xamarin特定版本)或2个测试机器(windows/windows版本)没有遇到任何问题 - 它们工作得很好 - 但另外两台测试机器(windows/windows版本)问题。

有困难查明为什么会出现这种情况

使用.NET 4.5

肯定有剃刀引擎DLL存在,并在引导程序,甚至强制引用(没有抛出异常)

任何线索?谢谢!

编辑1:这是完整的堆栈跟踪,根据要求。我后来将其更改为明确的'index.cshtml',但报告的错误基本相同(您只能在消息中的索引后看到.cshtml)。注意缺乏CSHTML作为支持视图扩展

Nancy.RequestExecutionException: Oh noes! ---> Nancy.ViewEngines.ViewNotFoundException:  Unable to locate view 'index' 
Currently available view engine extensions: sshtml,html,htm 
Locations inspected: views/Home/index-en-US,views/Home/index,Home/index-en-US,Home/index,views/index-en-US,views/index,index-en-US,index 
Root path: XXX 
If you were expecting raw data back, make sure you set the 'Accept'-header of the request to correct format, for example 'application/json' 
    at Nancy.ViewEngines.DefaultViewFactory.GetRenderedView(String viewName, Object model, ViewLocationContext viewLocationContext) 
    at Nancy.ViewEngines.DefaultViewFactory.RenderView(String viewName, Object model, ViewLocationContext viewLocationContext) 
    at Nancy.Responses.Negotiation.ViewProcessor.Process(MediaRange requestedMediaRange, Object model, NancyContext context) 
    at Nancy.Responses.Negotiation.DefaultResponseNegotiator.NegotiateResponse(IEnumerable`1 compatibleHeaders, NegotiationContext negotiationContext, NancyContext context) 
    at Nancy.Responses.Negotiation.DefaultResponseNegotiator.CreateResponse(IList`1 compatibleHeaders, NegotiationContext negotiationContext, NancyContext context) 
    at Nancy.Responses.Negotiation.DefaultResponseNegotiator.NegotiateResponse(Object routeResult, NancyContext context) 
    at Nancy.Routing.DefaultRouteInvoker.<>c__DisplayClass9.b__5(Task`1 completedTask) 
    --- End of inner exception stack trace --- 
    at Nancy.NancyEngine.InvokeOnErrorHook(NancyContext context, ErrorPipeline pipeline, Exception ex) 
+0

该异常包含有关南茜试图找到index.hrml信息。你可以看看这个问题并将信息添加到问题中吗? – 2014-09-13 08:00:38

+0

出错:“当前可用的视图引擎扩展:sshtml,html,htm” – 2015-03-13 07:29:30

回答