Resources

K

Kimmo Laine

Hi!

How can i add existing resource file to a C# project in VS2005 without
breaking the connection?

Lets say that i have a resource file, "MyStrings.resx", with one single
string resource MY_STRING = "Hello!". When i create this file, VS will
automatically add another file to my project - "MyStrings.Designer.cs".
Because of this extra file, i can write code like this:

MessageBox.Show(MyStrings.MY_STRING);

But when i import (Add existing item) these two files to another project,
somethig goes wrong: i can add new string but the class file don´t update
automatically.

What is the correct way to import resources?


thx

Kimmo Laine
 
D

Dave Sexton

Hi Kimmo,

Did you try only importing the .resx file without the .cs file?

I assume VS 2005 will have no problem regenerating the code file for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top