我在ASP.NET MVC 5.2.3中有一个应用程序,NuGet安装了本地化的附属程序集,用于显示下载的pt-BR验证消息:
https://www.nuget.org/packages/Microsoft.AspNet.Mvc.pt-br/
它在我的开发环境中工作并加载所有pt-BR本地化字符串,但是当我在其中一个服务器上发布时,消息仍然显示在en-US中。
下面的屏幕截图显示了有关MVC版本和文化以及UI文化的一些信息:
似乎没有加载资源dll,但是,应用程序在pt-BR文化中运行。
资源DLL System.Web.Mvc.resources.dll位于/ bin / pt-BR文件夹中。
配置了web.config全球化部分:
<!-- language: lang-html -->
<globalization culture="pt-BR" uiCulture="pt-BR" enableClientBasedCulture="false" />
有人有想法吗?
bin目录内容列表:
\ BIN \ Antlr3.Runtime.dll
\ BIN \ Autofac.dll
\ BIN \ Autofac.Integration.Mvc.dll
\ BIN \ Autofac.Integration.WebApi.dll
\ BIN \ AutoMapper.dll
\ BIN \ AutoMapper.Net4.dll
\ BIN \ BootGridMvc.dll
\ BIN \ CookComputing.XmlRpcV2.dll
\ BIN \ EntityFramework.dll
\ BIN \ EntityFramework.SqlServer.dll
\ BIN \ MyApp.Core.Business.dll
\ BIN \ MyApp.Core.Data.dll
\ BIN \ MyApp.Core.Models.dll
\ BIN \ MyApp.Core.Report.dll
\ BIN \ MyApp.Web.Mvc.dll
\ BIN \ itextsharp.dll
\ BIN \ Microsoft.AspNet.Identity.Core.dll
\ BIN \ Microsoft.AspNet.Identity.EntityFramework.dll
\ BIN \ Microsoft.AspNet.Identity.Owin.dll
\ BIN \ Microsoft.Owin.dll
\ BIN \ Microsoft.Owin.Host.SystemWeb.dll
\ BIN \ Microsoft.Owin.Security.Cookies.dll
\ BIN \ Microsoft.Owin.Security.dll
\ BIN \ Microsoft.Owin.Security.Facebook.dll
\ BIN \ Microsoft.Owin.Security.Google.dll
\ BIN \ Microsoft.Owin.Security.MicrosoftAccount.dll
\ BIN \ Microsoft.Owin.Security.OAuth.dll
\ BIN \ Microsoft.Owin.Security.Twitter.dll
\ BIN \ Microsoft.Web.Infrastructure.dll
\ BIN \ Newtonsoft.Json.dll
\ BIN \ Owin.dll
\ BIN \ Portable.Licensing.dll
\ BIN \ System.Net.Http.Formatting.dll
\ BIN \ System.Web.Helpers.dll
\ BIN \ System.Web.Http.dll
\ BIN \ System.Web.Http.WebHost.dll
\ BIN \ System.Web.Mvc.dll程序
\ BIN \ System.Web.Optimization.dll
\ BIN \ System.Web.Razor.dll
\ BIN \ System.Web.WebPages.Deployment.dll
\ BIN \ System.Web.WebPages.dll
\ BIN \ System.Web.WebPages.Razor.dll
\ BIN \ T4MVCExtensions.dll
\ BIN \ WebGrease.dll
\ BIN \ PT-BR
\ bin \ pt-br \ System.Web.Mvc.resources.dll
答案 0 :(得分:1)
这可能是一个愚蠢的建议,但请确保在.nuspec文件中引用本地化资源dll,以便在打包NuGet包时实际包含它们。