System.Resources.MissingManifestResourceException:

好久没遇到这种错误了 ,记录一下。

未能找到任何适合于指定的区域性或非特定区域性的资源。请确保在编译时已将“Test.Common.Resource.Messages.resources”正确嵌入或链接到程序集“Test”,或者确保所有需要的附属程序集都可加载并已进行了完全签名。

 

原因是路径不对。

如Messages.resx。

命名空间是:namespace     Test.Common.Resource

     /// <summary>

        ///   返回此类使用的缓存的 ResourceManager 实例。

         /// </summary>

        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]

        public static global::System.Resources.ResourceManager ResourceManager

        {

            get

            {

                if (object.ReferenceEquals(resourceMan, null))

                {

                   //这里面的路径一定要注意:<命名空间名+资源名称>的格式 
                global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Test.Common.Resource.Messages", typeof(Messages).Assembly);

                    resourceMan = temp;

                }

                return resourceMan;

            }

        }

你可能感兴趣的:(exception)