user3660295
user3660295

Reputation:

How can I change an .exe file icon before compiling (using csc) c#

I want to change an .exe file icon before compiling with csc .

as example : I hava a *.cs file and want to compile it to an .exe file . I am compiling with csc without using Visual Studio .

I can do it using this way in VS : (To specify an application icon In Solution Explorer, choose a project node (not the Solution node). On the menu bar, choose Project, Properties. When the Project Designer appears, choose the Application tab. In the Icon list, choose an icon (.ico) file. ) but I want to do a similar way (programatically) , using csc .

Is it possible to change file icon with csc (c sharp compiler )?

tnx

Upvotes: 2

Views: 3255

Answers (1)

Xiaoy312
Xiaoy312

Reputation: 14477

The /win32icon option inserts an .ico file in the output file, which gives the output file the desired appearance in the File Explorer.

/win32icon:filename

If you have some time, take a look to the list of C# Compiler Options.

Upvotes: 7

Related Questions