473,394 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

.resources files works with Command Line Compiler but not from VS2

GT
Hello

I'm trying to embed .resource files into a Windows application in VS2005,
and then compile and run the program from VS2005. This does not work because
the debugger seems not find the resource files, and I keep getting the
following error:

"MissingManifestResourceException:
Could not find any resources appropriate for the specified culture (or the
neutral culture) on disk. baseName: String locationInfo: <null fileName:
String.resources"

The code does however work when using the Command Line Compiler, and
lauching the application from the command window.
What is the reason for this?
Are there some special settings in VS2005 that I'm missing?

My example code is very simple and can be tested doing the following:

1) Open a new Project in VS2005: Visual C#>Windows>Windows Application
2) Delete Form1.cs
3) Replace the Main method of Program.cs with the following code:

CultureInfo ci = new CultureInfo("de-DE");
Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("de-DE");
ResourceManager rm = ResourceManager.CreateFileBasedResourceManager
("String", "de-DE", null);
Console.WriteLine(rm.GetString("wednesday", ci));

4) Add the using statements
using System.Resources;
using System.Threading;
using System.Globalization;
using System.Reflection;

5)Add a new folder "de-DE" and add a text file named 'String.de-DE.txt' to
the folder

6)Open 'String.de-DE.txt' and write 'wednesday=Mitwoch'

7)Open the VS Command Window and locate the de-DE folder. Then use
resgen.exe to generate a .resource file by writing 'resgen String.de-DE.txt'.

8) Type 'cd..'

9) Compile the solution with the Command Line Compiler writing
'csc /res:de-DE\String.de-DE.resources *.cs'

10) Run the example by typing 'Program'. This should will display 'Mitwoch'
in the command window

Now try to debug and run the application from Visual Studio 2005 (F5). This
will cause the above mentioned error. Why?
Aug 1 '06 #1
0 1460

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

Similar topics

2
by: aladdin | last post by:
I use outside .jpg picture files in a Windows Form project. I try to compile use csc.exe at command line. I use resgen.exe to generate a resource file like: resgen.exe Form1.resx...
3
by: Aquila Deus | last post by:
Hi all! Is there any command-line tool that can add/delete and replace string and files in .resources?
2
by: john townsley | last post by:
i have a .cpp file and i want to have my class and member functions in a seperate file. if i put the class heading file in a .h and the member functions for the class in a .cpp. how do i compile...
5
by: Marcus Ahlberg | last post by:
I've been coding a C# project in "pure code" and I would now want to import it into VS.net. I have created a project and imported all sourcefiles and it's compiling without problems, except for the...
0
by: amartos | last post by:
Hi, I am trying to create a dll file from several resources files. I am using visual studio .net and I have a c++ project which has included a file called "Resource.es-ES.resources", in the...
0
by: Louise Caldicott | last post by:
Hi all, I have created a project in Visual Studio which uses satellite assemblies. I have also written a script to build this project from the command line. There seems to be a difference in...
4
by: Jon Rista | last post by:
I have a project where I need to create a windows .exe by compiling code and linking in some resources. This program thats being generated is somewhat unconventional, and I'll explain how. I'm...
1
by: Lucvdv | last post by:
In an app that was working, all I did was specify an icon for the main form (through the form designer) and recompile it. Result: MissingManifestResourceException After digging around, I found...
0
by: shamirza | last post by:
· When was .NET announced? Bill Gates delivered a keynote at Forum 2000, held June 22, 2000, outlining the .NET 'vision'. The July 2000 PDC had a number of sessions on .NET technology, and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...

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.