Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

/win32icon (Import an .ico File)

/win32icon:filename

where:

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

Remarks

The /win32icon option inserts an .ico file in the output file, which gives the output file the desired appearance in the Windows Explorer. An .ico file can be created with the Resource Compiler. The Resource Compiler is invoked when you compile a Visual C++ program; an .ico file is created from the .rc file.

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

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Setting Visual C# Project Properties.
  2. Click the Common Properties folder.
  3. Click the General property page.
  4. Modify the Application Icon property.

To set this compiler option programmatically

See ApplicationIcon Property.

Example

Compile in.cs and attach an .ico file rf.ico to produce in.exe:

csc /win32icon:rf.ico in.cs

See Also

C# Compiler Options

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft