Resgen exe windows sdk

Resgen.exe (Resource File Generator)

The Resource File Generator (Resgen.exe) converts text (.txt or .restext) files and XML-based resource format (.resx) files to common language runtime binary (.resources) files that can be embedded in a runtime binary executable or satellite assembly. (See Creating Resource Files.)

Resgen.exe is a general-purpose resource conversion utility that performs the following tasks:

Converts .txt or .restext files to .resources or .resx files. (The format of .restext files is identical to the format of .txt files. However, the .restext extension helps you identify text files that contain resource definitions more easily.)

Converts .resources files to text or .resx files.

Converts .resx files to text or .resources files.

Extracts the string resources from an assembly into a .resw file that is suitable for use in a Windows 8.x Store app.

Creates a strongly typed class that provides access to individual named resources and to the ResourceManager instance.

If Resgen.exe fails for any reason, the return value is –1.

To get help with Resgen.exe, you can use the following command, with no options specified, to display the command syntax and options for Resgen.exe:

You can also use the /? switch:

If you use Resgen.exe to generate binary .resources files, you can use a language compiler to embed the binary files into executable assemblies, or you can use the Assembly Linker (Al.exe) to compile them into satellite assemblies.

This tool is automatically installed with Visual Studio. To run the tool, use Visual Studio Developer Command Prompt or Visual Studio Developer PowerShell.

At the command prompt, type the following:

Syntax

Parameters

Parameter or switch Description
/define: symbol1[, symbol2. ] Starting with the .NET Framework 4.5, supports conditional compilation in text-based (.txt or .restext) resource files. If symbol corresponds to a symbol included in the input text file within a #ifdef construct, the associated string resource is included in the .resources file. If the input text file includes an #if ! statement with a symbol that is not defined by the /define switch, the associated string resource is included in the resources file.

/define is ignored if it is used with non-text files. Symbols are case-sensitive.

For more information about this option, see Conditionally Compiling Resources later in this topic. useSourcePath Specifies that the input file’s current directory is to be used to resolve relative file paths. /compile Enables you to specify multiple .resx or text files to convert to multiple .resources files in a single bulk operation. If you do not specify this option, you can specify only one input file argument. Output files are named filename.resources.

This option cannot be used with the /str: option.

For more information about this option, see Compiling or Converting Multiple Files later in this topic. /r: assembly References metadata from the specified assembly. It is used when converting .resx files and allows Resgen.exe to serialize or deserialize object resources. It is similar to the /reference: or /r: options for the C# and Visual Basic compilers. filename.extension Specifies the name of the input file to convert. If you’re using the first, lengthier command-line syntax presented before this table, extension must be one of the following:

.txt or .restext
A text file to convert to a .resources or a .resx file. Text files can contain only string resources. For information about the file format, see the «Resources in Text Files» section of Creating Resource Files.

.resx
An XML-based resource file to convert to a .resources or a text (.txt or .restext) file.

.resources
A binary resource file to convert to a .resx or a text (.txt or .restext) file.

If you’re using the second, shorter command-line syntax presented before this table, extension must be the following:

.exe or .dll
A .NET Framework assembly (executable or library) whose string resources are to be extracted to a .resw file for use in developing Windows 8.x Store apps. outputFilename.extension Specifies the name and type of the resource file to create.

This argument is optional when converting from a .txt, .restext, or .resx file to a .resources file. If you do not specify outputFilename , Resgen.exe appends a .resources extension to the input filename and writes the file to the directory that contains filename,extension .

The outputFilename.extension argument is mandatory when converting from a .resources file. Specify a file name with the .resx extension when converting a .resources file to an XML-based resource file. Specify a file name with the .txt or .restext extension when converting a .resources file to a text file. You should convert a .resources file to a .txt file only when the .resources file contains only string values. outputDirectory For Windows 8.x Store apps, specifies the directory in which a .resw file that contains the string resources in filename.extension will be written. outputDirectory must already exist. /str: language[,namespace[,classname[,filename]]] Creates a strongly typed resource class file in the programming language specified in the language option. language can consist of one of the following literals:

— For C#: c# , cs , or csharp .
— For Visual Basic: vb or visualbasic .
— For VBScript: vbs or vbscript .
— For C++: c++ , mc , or cpp .
— For JavaScript: js , jscript , or javascript .

The namespace option specifies the project’s default namespace, the classname option specifies the name of the generated class, and the filename option specifies the name of the class file.

The /str: option allows only one input file, so it cannot be used with the /compile option.

If namespace is specified but classname is not, the class name is derived from the output file name (for example, underscores are substituted for periods). The strongly typed resources might not work correctly as a result. To avoid this, specify both class name and output file name.

For more information about this option, see Generating a Strongly Typed Resource Class later in this topic. /publicClass Creates a strongly typed resource class as a public class. By default, the resource class is internal in C# and Friend in Visual Basic.

This option is ignored if the /str: option is not used.

Resgen.exe and Resource File Types

In order for Resgen.exe to successfully convert resources, text and .resx files must follow the correct format.

Text (.txt and .restext) Files

Text (.txt or .restext) files may contain only string resources. String resources are useful if you are writing an application that must have strings translated into several languages. For example, you can easily regionalize menu strings by using the appropriate string resource. Resgen.exe reads text files that contain name/value pairs, where the name is a string that describes the resource and the value is the resource string itself.

For information about the format of .txt and .restext files, see the «Resources in Text Files» section of Creating Resource Files.

A text file that contains resources must be saved with UTF-8 or Unicode (UTF-16) encoding unless it contains only characters in the Basic Latin range (to U+007F). Resgen.exe removes extended ANSI characters when it processes a text file that is saved using ANSI encoding.

Resgen.exe checks the text file for duplicate resource names. If the text file contains duplicate resource names, Resgen.exe will emit a warning and ignore the second value.

.resx Files

The .resx resource file format consists of XML entries. You can specify string resources within these XML entries, as you would in text files. A primary advantage of .resx files over text files is that you can also specify or embed objects. When you view a .resx file, you can see the binary form of an embedded object (for example, a picture) when this binary information is a part of the resource manifest. As with text files, you can open a .resx file with a text editor (such as Notepad or Microsoft Word) and write, parse, and manipulate its contents. Note that this requires a good knowledge of XML tags and the .resx file structure. For more details on the .resx file format, see the «Resources in .resx Files» section of Creating Resource Files.

Resgen exe windows sdk

Опытный

Профиль
Группа: Участник
Сообщений: 588
Регистрация: 20.4.2009

Репутация: нет
Всего: нет

Создаю в SharpDevelop 4.1 проект Windows Application на фреймворке 3.5. Если приложение без графического интерфейса, то проект собирается нормально. А если добавляю какие-нибудь формы (кнопки, лейблы), то сборке выдает:

Задача не выполнена, так как не обнаружен «resgen.exe» или не установлен пакет .NET Framework SDK 1. Задача ищет «resgen.exe» в подкаталоге «bin» внутри каталога, заданного значением InstallationFolder ключа реестра HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A. Возможно, неполадку удастся устранить, выполнив одно из следующих действий: 1) Установите Microsoft Windows SDK. 2) Установите Visual Studio 2010. 3) Вручную задайте в указанном выше разделе реестра правильное расположение. 4) Передайте правильное расположение в параметр ToolPath задачи. (MSB3091)

Поискал этот файл resgen.exe — его нет. Подскажите, откуда можно его скачать и куда нужно положить?

Через сайт Microsoft не могу скачать SDK, так как файервол блокирует.

Suppir
Дата 24.2.2012, 12:58 (ссылка) | (нет голосов) Загрузка .
Voyager
Дата 25.2.2012, 02:55 (ссылка) | (нет голосов) Загрузка .

Опытный

Профиль
Группа: Участник
Сообщений: 532
Регистрация: 8.2.2005

Репутация: 3
Всего: 18

Установите Microsoft .NET Framework SDK Version 2.0

Опытный

Профиль
Группа: Участник
Сообщений: 588
Регистрация: 20.4.2009

Репутация: нет
Всего: нет

Suppir
Дата 2.3.2012, 20:40 (ссылка) | (нет голосов) Загрузка .

можно все решить проще — заходите в tools->project upgrade и поменяйте внизу версию языка с C# 5.0 на C# 3.0, после чего нажмите Convert.

Этот ответ добавлен с нового Винграда — http://vingrad.com

koroteeww
Дата 11.5.2016, 16:09 (ссылка) | (голосов: 0) Загрузка .
Прежде чем создать тему, посмотрите сюда:
  • Что же такое .NET? Краткое описание,изучаем.
  • Какой язык программирования выбрать? выбираем.
  • C#. С чего начать? начинаем.
  • Защита исходного кода .NET приложений, защищаем.
  • Литература по .NET, обращаемся.
  • FAQ раздела,ищем здесь.
  • Архиполезные ссылки:www.connectionstrings.com, www.pinvoke.net, www.codeproject.com

Используйте теги [code=csharp][/code] для подсветки кода. Используйтe чекбокс «транслит» если у Вас нет русских шрифтов.
Что делать если Вам помогли, но отблагодарить помощника плюсом в репутацию Вы не можете(не хватает сообщений)? Пишите сюда, или отправляйте репорт. Поставим 🙂
Так же не забывайте отмечать свой вопрос решенным, если он таковым является 🙂

Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, mr.DUDA, THandle.

0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | Общие вопросы по .NET и C# | Следующая тема »

[ Время генерации скрипта: 0.1257 ] [ Использовано запросов: 21 ] [ GZIP включён ]

Читайте также:  Не работает внешний жесткий диск mac os
Оцените статью