Asp.Net Identity Localization PublicKeyToken

.net, asp.net-identity, asp.net-mvc, c#, dll

Solution

Not unless you have the private key that Microsoft uses to sign dlls.

Updated: as a workaround until we add support for plugging in your own resources, you can probably just wrap all the default identity result error messages with an explicit switch for now, there should only be about 10-20 user facing errors.

Something like:

public static string Localize(string error) {
     switch (error) {
          case "<english error>": return "<localized version";
     }
}

Problem

I'm trying to get localized error messages for Swedish for Asp.Net Identity by using advice from this post: How to localize ASP.NET Identity UserName and Password error messages? Using NuGet I downloaded the German language pack and then opened \packages\Microsoft.AspNet.Identity.Core.2.0.0\lib\net45\de\Microsoft.AspNet.Identity.Core.resources.dll in dotPeek and then exported this to a new VS project: https://github.com/nielsbosma/AspNet.Identity.Resources.Swedish/ I've copied the generated \Microsoft.AspNet.Identity.Core.resources.dll to a new folder under \packages\Microsoft.AspNet.Identity.Core.2.0.0\lib\net45\se. When I run my site locally I see that Microsoft.AspNet.Identity.Core.resources.dll has been copied to MySite\bin\sv\ But I can't get it to work :( If I set in my Web.config: ``` <system.web> ... <globalization culture="sv-SE" uiCulture="sv" /> </system.web> ``` I still get english default error messages. But if I change to german that I've included from NuGet I get german error messages. Using dotPeek I've compared my dll with the german and they are the same except my has PublicKeyToken=null and the one for german is "31bf3856ad364e35". Could this be why I can't get my dll to load? Is there anyway to set a PublicKeyToken for a dll? Any workaround? Thanks for any pointers.

Original source

Related problems