Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing a resource file

Status
Not open for further replies.

kav123

Programmer
Jan 12, 2005
210
GB
Anyone ever changed a resource file before. Whenever i try to change it, it is breaking the entire solution. It fails to build.
 
how are you trying to change it? And how, specifically, is it breaking the solution? runtime, compile time?

if you change the name of the resource then you will need to update the references to that resource through the application. if you're changing the contents, than that's another matter which is specific to the content.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
I am changing the existing contents of the file. And the solutiong fails to build. So, it is not compiling at all.
 
The error i am getting at compile time is that the resource file is inaccessible because of its protection level.
 
the exception should give more information: file, line, exception type, message. start there to track down the problem. browse the resource.desgin.cs/vb file, as this is where the problem lies.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
The problem i am having is, when i add a new key/value pair to the resource file, the access modifiers change to internal. Hence files outside that project cannot access it. WHat is the method to create a resource file or changing one. We should not change the code in the designer file
 
if the values are internal they can only be seen by the current assembly. create an adapter to expose the resources.
Code:
public class PublicReadonlyAccessToResourcesOfMyAssembly
{
   public static string This_Resource
   {
        get { return Resources.ThisResource; }
   }

   public static string That_Resource
   {
        get { return Resources.ThatResource; }
   }
}

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Thanks, can this class be in a different project altogether i.e. same solution but different project.
 
no, because the resources are internal to that assembly.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top