Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / February 2008

Tip: Looking for answers? Try searching our database.

C# Resources.resx Question (VS2008)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
NvrBst - 06 Feb 2008 19:24 GMT
I need my resource file in a generic namespace to be accessable by a
shared class.  I change the Resources.resx File Properties -> Custom
Tool Namespace: MyResources.  This field is under the "Custom Tool:
ResXFileCodeGenerator" property.

This works fine.  I can now access the resource like so
"MyResources.MyBitmapFile" etc.  However, when looking into the
"Resources.Designer.cs" file I see the following line:

new
global::System.Resources.ResourceManager("MyProj.Properties.Resources",
typeof(Resources).Assembly);

Should "MyProj.Properties.Resources" not be "MyResources.Resources"?
The Program seems to work both ways but whenever I change it to
"MyResources.Resources" it seems to randomly switch back to the
"MyProj.Properties..." (namily when I add new resources to the file,
among other actions).  Is this something I should bother to keep
changing? Or is the "Custom Tool Namespace" not suppose to be used
like this?  Maybe suggestions on the proper way to do it?

Thanks
NB
Nicholas Paldino [.NET/C# MVP] - 06 Feb 2008 19:34 GMT
The designer is changing the code back for you.

   The parameter you are seeing is for the root name of the resource file,
not the namespace that the class is a member of.  So you don't need to
change it (the designer would have done it for you if you needed to change
it).

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

>I need my resource file in a generic namespace to be accessable by a
> shared class.  I change the Resources.resx File Properties -> Custom
[quoted text clipped - 19 lines]
> Thanks
> NB
NvrBst - 06 Feb 2008 20:05 GMT
On Feb 6, 11:37 am, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.com> wrote:
>     The designer is changing the code back for you.
>
[quoted text clipped - 32 lines]
>
> - Show quoted text -

Ahh thank you.  Seems I was a little confused with what root name
was :)

NB

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.