2017-08-18 3 views
2

Ich habe eine Startup-Vorlage für ASP.NET Boilerplate heruntergeladen.Asp.Net Boilerplate Startup Template - Kultur Ausgabe

Die Anweisungen zum Erstellen und Initialisieren der Datenbank wurden erfolgreich befolgt.

Als ich gekommen, um die Anwendung auszuführen, ich bin mit dem folgenden Fehler dargestellt:

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 

Soweit ich erkennen kann, die vn Kulturbezeichner ist jedoch Vietnamese Ich bin nicht in der Lage zu bestimmen, wie dies Fehler wird generiert und was kann ich tun, um sicherzustellen, dass die en Kultur verwendet wird, wie ich in Großbritannien bin.

Jeder Rat würde sehr erhalten werden.

+0

Die Datenbank scheint jedoch für 'en' Kultur aufgebaut wird dies deutlich ignoriert wird, aber ich kann nicht herausfinden, wo ... – weblar83

Antwort

3

Öffnen Sie DefaultLanguagesCreator Klasse und ändern Sie die Konstruktormethode mit den folgenden;

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 müssen Sie Ihre Datenbank, weil Samen Methode, um Ihre vorhandenen Sprachen aktualisieren nicht zu aktualisieren. Öffne AbpLanguages-Tabelle und aktualisiere die Zeile für Vietnamesisch; Name = vi, Symbol = famfamfam-flags vi.

update AbpLanguages set Name='vi', Icon='famfamfam-flags' where Name='vn' 
+0

Danke, dass das Problem behoben hat – weblar83

+0

Sie willkommen sind. –

Verwandte Themen