9

I have an application in ASP.NET MVC 5.2.3 with localized satellite assemblies installed by NuGet to show pt-BR validation messages downloaded in:

https://www.nuget.org/packages/Microsoft.AspNet.Mvc.pt-br/

It works and loads all pt-BR localized strings in my development environment, but when I publish in one of our servers the messages still showed in en-US.

The screenshot bellow shows some information about MVC Version and Culture and UI Culture:

enter image description here

It seems that the resource dll wasn't loaded, but, the application is running in pt-BR culture.

The resource DLL System.Web.Mvc.resources.dll is found in /bin/pt-BR folder.

The web.config globalization section is configured:

<!-- language: lang-html -->

    <globalization culture="pt-BR" uiCulture="pt-BR" enableClientBasedCulture="false" />

Anyone has an idea?

bin directory content list:

\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

Johnathon Sullinger
  • 7,097
  • 5
  • 37
  • 102
  • Please list the entire contents of your `bin` directory, including all subfolders. You should have a localized satellite-assembly: `bin\pt-BR\yourSite.dll`. – Dai May 27 '15 at 21:03
  • I don't have a resource in my site, I just use a resource of System.Web.Mvc for MVC validation messages. My site is entirely in pt-BR. Do I need rename this dll? System.Web.Mvc.resources.dll – Luciano Gerhardt May 28 '15 at 12:17
  • It works in all development machines of my team, even in Debug and Release modes and Published in local IIS, with Windows in portuguese and english. But only when I publish in one of our servers and in customer server it doesn't works. – Luciano Gerhardt May 28 '15 at 12:22
  • Do you have the 'Copy Local' field set to 'True' under your references in Visual Studio for the pt-br dll? It likely works in local due to the dll existing on the local machine. The client/production server does not have a copy of the dll and falls back to the english version. Just a guess. – Pynt Jun 30 '15 at 18:58
  • Yes, System.Web.Mvc have the 'Copy Local' field set to 'True'. According to http://stackoverflow.com/questions/1841541/how-to-add-satellite-assemblies-to-a-project-in-visual-studio, the satellite assemblies are copyed with the referenced assembly, and I can see in bin/pt-br/ folder the resource DLL after build. – Luciano Gerhardt Jul 02 '15 at 11:58

1 Answers1

1

It might be a stupid suggestion, but make sure that you reference the localized resource dll's in your .nuspec file so that they are actually included when you package the NuGet bundle.

Sebastian P.
  • 818
  • 8
  • 20