473,480 Members | 3,135 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

VS2005 C# and Resources

bob
Hi,
I am having trouble with Resources of a windows app.
If I understand correctly.
1) New C# Windows app. Namespace 'TestResources'
2) Edit default Resources file, set String1 value to say "MyApp"
3) Put the following code in ctor after InitializeComponent
ResourceManager rm = new ResourceManager("Resources",
Assembly.GetExecutingAssembly());

String s = rm.GetString("String1");///BREAKS HERE///

MessageBox.Show(s);

It breaks with a MissingManifestResourceException

Am I missing a setting ?

Thanks

Bob


Feb 18 '06 #1
2 1842
> Hi,
I am having trouble with Resources of a windows app.
If I understand correctly.
1) New C# Windows app. Namespace 'TestResources'
2) Edit default Resources file, set String1 value to say "MyApp"
3) Put the following code in ctor after InitializeComponent
ResourceManager rm = new ResourceManager("Resources",
Assembly.GetExecutingAssembly());
String s = rm.GetString("String1");///BREAKS HERE///

MessageBox.Show(s);

It breaks with a MissingManifestResourceException

Am I missing a setting ?

Thanks

Bob


VS2005 produces typesafe access to your resources, at least if you use the
default editors. Try Resources.String1.

--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:la***@vkarlsen.no
PGP KeyID: 0x2A42A1C2
Feb 20 '06 #2
Bob
Hi,
Thanks ,
You put me on the right track.
Intellisense access to the default Resources is a fully formed name starting
at project Level.
(Project TestResources)
String s =TestResources.Properties.Resources.String1;
Is that little pearl of wisdom documented anywhere?
Are you told that you need "using TestResources.Properties" to make
reasonable use of the Resources object?
Nooo you are not.
Documentation in this area is inadequate in my opinion.

Thanks again for your help.
Bob

"Lasse Vågsæther Karlsen" <la***@vkarlsen.no> wrote in message
news:9d**************************@news.microsoft.c om...
Hi,
I am having trouble with Resources of a windows app.
If I understand correctly.
1) New C# Windows app. Namespace 'TestResources'
2) Edit default Resources file, set String1 value to say "MyApp"
3) Put the following code in ctor after InitializeComponent
ResourceManager rm = new ResourceManager("Resources",
Assembly.GetExecutingAssembly());
String s = rm.GetString("String1");///BREAKS HERE///

MessageBox.Show(s);

It breaks with a MissingManifestResourceException

Am I missing a setting ?

Thanks

Bob


VS2005 produces typesafe access to your resources, at least if you use the
default editors. Try Resources.String1.

--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:la***@vkarlsen.no
PGP KeyID: 0x2A42A1C2

Feb 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2045
by: Rob Dob | last post by:
Hi, I'm amazed!!! I am using VS2005, I create a new web project, c# and then within the default.aspx form right mouse click and select "View Compnent Designer" , I then select and drag a...
3
2149
by: musosdev | last post by:
Hi guys I've got the following error on a project which is running locally on a vs2005 machine (built in webserver), trying to connect to my win2k3 server active directory. the error is... ...
11
1460
by: CMM | last post by:
I am so disappointed in VS2005. The "little things" wrong with it are just mind-boggling. Boy, I'll be so mad if I have to wait a year for the ".1" release that fixes all the bugs in this obvious...
1
1345
by: Bob | last post by:
Hi, My app is now successfully accessing the default Resources.resx. I have made a Resources.fr-FR.resx yet .. #if (French) Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR",...
5
1681
by: Terry Jolly | last post by:
Here's the problem/question. The goal: run asp pages with apsx pages in the same solution with VS2005 IDE I've loaded my asp pages into a new VS2005. However the asp pages would not run. So, I...
9
1300
by: DrZogg | last post by:
It can't be... say it isn't so... Yes.. there is a fly in the ointment This bug requires 3 projects... yes this is a real world production issue not some tinker toy thing. Start with a C#...
0
1462
by: GT | last post by:
This question has been posted before, but without any response so therefore I'm trying once more. I'm trying to embed .resource files into a Windows application in VS2005, and then compile and...
3
3119
by: clintonG | last post by:
I like the idea of LINQ but don't have the resources for Orcas at this time and know little about the requirements for LINQ. Anybody want to give me a quick earful? <%= Clinton Gallagher NET...
0
1245
by: Academia | last post by:
I have a vs2003 solution that I want to convert to VS2005 format. These projects have been converted and now compile in VS2005. But they had the older format - they is the UI code was in .vb...
0
6920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7061
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7110
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5367
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4503
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3011
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
574
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
210
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.