ResourceManager trying to load .resources not .resx file

前端 未结 5 1757
陌清茗
陌清茗 2021-01-11 12:21

I am trying to load a resx file in my .net website using:

ResourceManager rm = new ResourceManager( \"Project.Resource\", Assembly.GetExecutingAssembly() );
         


        
5条回答
  •  臣服心动
    2021-01-11 13:00

    I'm not sure which version of .NET Framework are you using.

    Try channging the way how you bring the ResourceManager to life.

    ResourceManager rm = 
         new ResourceManager("Project.Resource", 
                             System.Reflection.Assembly.Load("App_LocalResources"));
    

    It should work.

    This is also exposed as a static property of the automatically generated .designer.cs class of the concrete resorce manager.

提交回复
热议问题