resX Files
-
I am trying to add an existing resX file to my project and it won't take. Any reason? Are this added differently or create in some other way (new to this .NET stuff) thanks Ralph
What do you mean "it won't take". Please be more technical, as this is a technical forum. If you mean it won't compile to a .resources file and get embedded in your assembly, right-click on the file, select Properties, and change the Build Action to "Embedded Resource". If you're new to .NET, you should definitely read the .NET Framework SDK. It contains many topics - including localization with resx files - and the class library documentation for the .NET Framework itself. See http://msdn.microsoft.com/netframework/using/[^] for more information and links to the .NET Framework SDK on MSDN Library Online. Browsing the MANY articles here on .NET and C# on CodeProject can also be beneficial. There are many examples and code-snippets for all levels of programmers. Just browse the relevent categories.
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
-
What do you mean "it won't take". Please be more technical, as this is a technical forum. If you mean it won't compile to a .resources file and get embedded in your assembly, right-click on the file, select Properties, and change the Build Action to "Embedded Resource". If you're new to .NET, you should definitely read the .NET Framework SDK. It contains many topics - including localization with resx files - and the class library documentation for the .NET Framework itself. See http://msdn.microsoft.com/netframework/using/[^] for more information and links to the .NET Framework SDK on MSDN Library Online. Browsing the MANY articles here on .NET and C# on CodeProject can also be beneficial. There are many examples and code-snippets for all levels of programmers. Just browse the relevent categories.
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
Thanks I will take a peek but I will reiterate. I have 2 projects and am moving some controls from 1 to the other. In the first project, there are a bunch of .resX file in the project tree. I copy those files to my new project directory, try to add them like I would any other file (via context menu). Basically it doesn’t add it to the tree like on would expect. I can add cs files, etc, but not these .resX files. I hope that is a bit clearer.. sorry for the confusion…
-
Thanks I will take a peek but I will reiterate. I have 2 projects and am moving some controls from 1 to the other. In the first project, there are a bunch of .resX file in the project tree. I copy those files to my new project directory, try to add them like I would any other file (via context menu). Basically it doesn’t add it to the tree like on would expect. I can add cs files, etc, but not these .resX files. I hope that is a bit clearer.. sorry for the confusion…
Again, what is the exact error? What exactly won't work? Please be specific. If you're copying those to your new project directory and trying to add them into that project, you should expect a "file exists" error. Instead, show the hidden files for that project by selecting an item in that project and click the Project menu, then Show All Files. Find the resx file in that directory, right-click, and select Include in Project. Make sure you take the namespaces changes into account if you didn't override the default namespace for your project (if necessary) in the project configuration settings (right-click on the project and select Properties). In VS.NET, resx files are created using the root namespace of the project, followed by any directories in which the resx files are located, and are finally compiled to .resources file with the namespace and filename prepended.
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
-
Again, what is the exact error? What exactly won't work? Please be specific. If you're copying those to your new project directory and trying to add them into that project, you should expect a "file exists" error. Instead, show the hidden files for that project by selecting an item in that project and click the Project menu, then Show All Files. Find the resx file in that directory, right-click, and select Include in Project. Make sure you take the namespaces changes into account if you didn't override the default namespace for your project (if necessary) in the project configuration settings (right-click on the project and select Properties). In VS.NET, resx files are created using the root namespace of the project, followed by any directories in which the resx files are located, and are finally compiled to .resources file with the namespace and filename prepended.
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----