FxCop Do not pass literals as localized parameters warning

  • Thread starter Thread starter Tim Sprout
  • Start date Start date
T

Tim Sprout

FxCop gives a "Do not pass literals as localized parameters" warning on the
dot Text properties of my Form1 components in Form1.Designer. These are the
strings that label the buttons and form. I assume that I don't really need
to retrieve these strings using ResourceManager, or do I? How do I avoid
getting this error?

-Tim Sprout
 
FxCop gives a "Do not pass literals as localized parameters" warning on the
dot Text properties of my Form1 components in Form1.Designer. These are the
strings that label the buttons and form. I assume that I don't really need
to retrieve these strings using ResourceManager, or do I? How do I avoid
getting this error?

Yes, you need to retrieve them with a ResourceManager.

But there is not need to do this manually.
Just mark the form as localizable (in Properties) and the code generated by
the form editor will do the right thing (the strings will move to a resx
file)
 

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

Back
Top