1

I have an MVC program I am currently working and it has been a bit tricky because I have a Turkish Language resource implemented but whenever I fire up the site it insists that there is something wrong with the views. I have gotten the site to work when I set my locale in the DB from 'tr-TR' to 'tr'

The error only seems to have stopped happening, but I would like to know if anyone can elaborate on why .NET seems to be accepting the locale 'tr' instead of 'tr-TR'

[InvalidOperationException: The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:
    ~/Views/register/Index.cshtml
    ~/Views/register/Index.vbhtml
    ~/Views/Shared/Index.cshtml
    ~/Views/Shared/Index.vbhtml]
       System.Web.Mvc.ViewResult.FindView(ControllerContext context) +356626
       System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +121
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
       System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +23
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
       System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
       System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +177
       System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +324
       GoRun.Core.Web.HttpMethodActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) in c:\HttpMethodActionInvoker.cs:10
       System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__19() +23
       System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +19
       System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
       System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
       System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +57
       System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
       System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
       System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +47
       System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
       System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
       System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
       System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
       System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +47
       System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9657896
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
petrosmm
  • 528
  • 9
  • 23

1 Answers1

1

After a substantial amount of time I figured that when trying to access the 'index' (the i in the url path is case sensitive and becomes exceptionally sensitive according to the turkey test)

http://localhost:54133/Demo/Register/index and http://localhost:54133/Demo/Register/Index will yield a different results in Turkish locale... We ended up utilizing an application filter that applies '.tolocalinvariant' whenever the Routepath is called.

petrosmm
  • 528
  • 9
  • 23