2

I've downloaded a startup template for ASP.NET Boilerplate.

Having successfully followed the instructions to create and seed the database.

When I come to run the application, I'm presented with the following error:

Server Error in '/' Application.

Culture is not supported.
Parameter name: name
vn is an invalid culture identifier.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Globalization.CultureNotFoundException: Culture is not supported.
Parameter name: name
vn is an invalid culture identifier.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[CultureNotFoundException: Culture is not supported.
Parameter name: name
vn is an invalid culture identifier.]
   System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride) +192
   Abp.Localization.<>c.<Get>b__3_0(String n) +29
   System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +62
   Abp.Localization.CultureInfoHelper.Get(String name) +144
   Abp.Localization.MultiTenantLocalizationDictionaryProvider.CreateLocalizationDictionary(LanguageInfo language) +61
   Abp.Localization.<>c__DisplayClass11_0.<GetDictionaries>b__0(String s) +18
   System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +62
   Abp.Localization.MultiTenantLocalizationDictionaryProvider.GetDictionaries() +161
   Abp.Localization.MultiTenantLocalizationDictionaryProvider.get_Dictionaries() +10
   Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource.GetStringOrNull(String name, CultureInfo culture, Boolean tryDefaults) +42
   Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource.GetString(String name) +38
   Abp.Authorization.<AuthorizeAsync>d__19.MoveNext() +513
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   Abp.Authorization.<CheckPermissions>d__22.MoveNext() +255
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   Abp.Authorization.<AuthorizeAsync>d__20.MoveNext() +297
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   Nito.AsyncEx.<>c__DisplayClass15_0.<Run>b__0(Task t) +80
   System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke() +52
   System.Threading.Tasks.Task.Execute() +49
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   Nito.AsyncEx.AsyncContext.Run(Func`1 action) +201
   Abp.Authorization.AuthorizationHelperExtensions.Authorize(IAuthorizationHelper authorizationHelper, MethodInfo methodInfo, Type type) +82
   Abp.Web.Mvc.Authorization.AbpMvcAuthorizeFilter.OnAuthorization(AuthorizationContext filterContext) +197
   System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor) +97
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__19(AsyncCallback asyncCallback, Object asyncState) +743
   System.Web.Mvc.Async.WrappedAsyncResult`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +14
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
   System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeAction(ControllerContext controllerContext, String actionName, AsyncCallback callback, Object state) +343
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1c(AsyncCallback asyncCallback, Object asyncState, ExecuteCoreState innerState) +25
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +30
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
   System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state) +465
   System.Web.Mvc.Controller.<BeginExecute>b__14(AsyncCallback asyncCallback, Object callbackState, Controller controller) +18
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +20
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
   System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +374
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +16
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(AsyncCallback asyncCallback, Object asyncState, ProcessRequestState innerState) +52
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +30
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +384
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +48
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +103
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

As far as I can detect, the vn culture identifier is Vietnamese however I'm unable to determine how this error is generated and what I can do to ensure that the en culture is used as I'm based in the UK.

Any advice would be greatly received.

weblar83
  • 601
  • 6
  • 24
  • The database seems to be set up for `en` culture however this clearly is being ignored but I can't figure out where... – weblar83 Aug 18 '17 at 13:02

1 Answers1

3

Open DefaultLanguagesCreator class and change constructor method with the below;

static DefaultLanguagesCreator()
        {
            InitialLanguages = new List<ApplicationLanguage>
            {
                new ApplicationLanguage(null, "en", "English", "famfamfam-flags gb"),
                new ApplicationLanguage(null, "tr", "Türkçe", "famfamfam-flags tr"),
                new ApplicationLanguage(null, "zh-CN", "简体中文", "famfamfam-flags cn"),
                new ApplicationLanguage(null, "pt-BR", "Português-BR", "famfamfam-flags br"),
                new ApplicationLanguage(null, "es", "Español", "famfamfam-flags es"),
                new ApplicationLanguage(null, "fr", "Français", "famfamfam-flags fr"),
                new ApplicationLanguage(null, "it", "Italiano", "famfamfam-flags it"),
                new ApplicationLanguage(null, "ja", "日本語", "famfamfam-flags jp"),
                new ApplicationLanguage(null, "nl-NL", "Nederlands", "famfamfam-flags nl"),
                new ApplicationLanguage(null, "lt", "Lietuvos", "famfamfam-flags lt"),
                new ApplicationLanguage(null, "vi", "Vietnamese", "famfamfam-flags vi")
            };
        }

https://github.com/aspnetboilerplate/module-zero-template/blob/master/src/AbpCompanyName.AbpProjectName.EntityFramework/Migrations/SeedData/DefaultLanguagesCreator.cs

Plus, you need to update your database because seed method will not update your existing languages. Open AbpLanguages table and update the row for Vietnamese; Name=vi, Icon=famfamfam-flags vi.

update AbpLanguages set Name='vi', Icon='famfamfam-flags' where Name='vn'
Alper Ebicoglu
  • 6,488
  • 1
  • 34
  • 39