[Mono-aspnet-list] Could not find any resources appropriate for the specified culture or the neutral culture.

hjf1223 hjf1223 at gmail.com
Fri Dec 9 07:53:56 EST 2011


I have the following class to get the string resource from system assemblies:

*public static class SR

    {

        static SR()

        {

            System_Web_Resources = new ResourceManager("System.Web",
typeof(System.Web.HttpContext).Assembly);

            System_Web_Mvc_Resources = new
ResourceManager("System.Web.Mvc.Resources.MvcResources",
typeof(System.Web.Mvc.Controller).Assembly);

            System_ComponentModel_DataAnnotations_Resources = new
ResourceManager("System.ComponentModel.DataAnnotations.Resources.DataAnnotationsResources",
typeof(System.ComponentModel.DataAnnotations.DisplayAttribute).Assembly);            

            System_Linq_Resources = new ResourceManager("System.Linq",
typeof(System.Linq.Enumerable).Assembly);

        }

        public static ResourceManager System_Linq_Resources { get; private
set; }

        public static ResourceManager System_Web_Resources { get; private
set; }

        public static ResourceManager System_Web_Mvc_Resources { get;
private set; }

        public static ResourceManager
System_ComponentModel_DataAnnotations_Resources { get; private set; }

    }
*
It works fine on .NET/IIS, but under mono/linux, when this code executed:

*SR.System_Web_Resources.GetString("Path_not_found")*

It will throw this exception:

*Could not find any resources appropriate for the specified culture or the
neutral culture. Make sure "System.Web.resources" was correctly embedded or
linked into assembly "System.Web" at compile time, or that all the satellite
assemblies required are loadable and fully signed.*

--
View this message in context: http://mono.1490590.n4.nabble.com/Could-not-find-any-resources-appropriate-for-the-specified-culture-or-the-neutral-culture-tp4176502p4176502.html
Sent from the Mono - ASP.NET mailing list archive at Nabble.com.


More information about the Mono-aspnet-list mailing list