473,748 Members | 2,239 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.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:

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

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>Wind ows Application
2) Delete Form1.cs
3) Replace the Main method of Program.cs with the following code:

CultureInfo ci = new CultureInfo("de-DE");
Thread.CurrentT hread.CurrentCu lture = new CultureInfo("de-DE");
Thread.CurrentT hread.CurrentUI Culture = new CultureInfo("de-DE");
ResourceManager rm = ResourceManager .CreateFileBase dResourceManage r
("String", "de-DE", null);
Console.WriteLi ne(rm.GetString ("wednesday" , ci));

4) Add the using statements
using System.Resource s;
using System.Threadin g;
using System.Globaliz ation;
using System.Reflecti on;

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=Mitw och'

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 1495

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

Similar topics

2
453
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 MyNameSpace.MainForm.resources then use csc to compile: csc /nologo /t:winexe /out:app1.exe /res:MyNameSpace.MainForm.resources /win32icon:App.ico *.cs The output exe file has the same size as compiled in VS.NET IDE, however, at runtime the program still...
3
1732
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
1262
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 the 2 .cpp files eg 1 with class stuff and other main(). i know i include the .h file in the .cpp class member file but i cant compile the project without errors. how do i set-up and compile a program with class .h class .cpp, and main()
5
4722
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 resources. Before, I built the program using a batchfile and linked the resources with the "/resource:MainFrame.resX" option. Then I loaded them with this code: Assembly myAssembly = Assembly.GetAssembly(this.GetType()); Stream resXStream =...
0
1395
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 command line area of the page properties of this file I have included the next code: mkdir $(ProjectDir)..\bin\$(OutDir)\es-ES al.exe /culture:es-ES /out:"$(ProjectDir)..\bin\$(OutDir)\es-ES\Resource_Example.resources.dll" ...
0
1455
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 behaviour when I link the resources via Dev Studio and the command line.
4
5890
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 generating a very simple installer app that embeds referenced .dll files inside it, which are extracted and referenced when the installer app is executed. This works great when the installer app is built with Visual Studio .NET, but it does not work...
1
1225
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 that the compiler generates .resource files in the debug build of the application, for all forms except the main one (form1). The .resx file (with the icon in it) exists in the source directory,
0
3668
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 delegates were given CDs containing a pre-release version of the .NET framework/SDK and Visual Studio.NET. · When was the first version of .NET released? The final version of the 1.0 SDK and runtime was made publicly available around 6pm PST on...
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8243
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3313
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 we have to send another system

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.