/win32res (C# Compiler Options)

 

Updated: July 20, 2015

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

The /win32res option inserts a Win32 resource in the output file.

/win32res:filename  

filename
The resource file that you want to add to your output file.

A Win32 resource file can be created with the Resource Compiler. The Resource Compiler is invoked when you compile a Visual C++ program; a .res file is created from the .rc file.

A Win32 resource can contain version or bitmap (icon) information that would help identify your application in the File Explorer. If you do not specify /win32res, the compiler will generate version information based on the assembly version.

See /linkresource (to reference) or /resource (to attach) a .NET Framework resource file.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Properties page.

  2. Click the Application property page.

  3. Click on the Resource File button and choose a file by using the combo box.

Compile in.cs and attach a Win32 resource file rf.res to produce in.exe:

csc /win32res:rf.res in.cs  

C# Compiler Options
NIB How to: Modify Project Properties and Configuration Settings

Show: