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)
該異常包含有關南茜試圖找到index.hrml信息。你可以看看這個問題並將信息添加到問題中嗎? – 2014-09-13 08:00:38
出錯:「當前可用的視圖引擎擴展:sshtml,html,htm」 – 2015-03-13 07:29:30