I can already export a Visual Studio c# program to a single file exe. What I was curious about is if anyone knows of the console tag for adding a image to the exe or if I would have to do that in the properties beforehand. I tried in properties and it didn't work.
Asked
Active
Viewed 511 times
1
-
1Your question has already an answer: https://stackoverflow.com/questions/17489497/how-to-change-the-title-icon-of-a-windows-forms-application – JoséCoronelArgüelles Oct 27 '21 at 14:34
-
^^^Not quite what I meant. I mean the single executable file u get when the project is published through the console. – Virophage Oct 27 '21 at 17:47
2 Answers
1
From visual studio in the solution explorer right click on the project and select Properties. From Application tab in Resources grouping select an icon that icon will be applied to the executable file.
In addition if you would create a setup project and add shortcut to the desktop then you have to separately select an icon for the shortcut.

Karen
- 60
- 1
- 9
-
-
Can't post image I guess but this worked! This is basically the same thing my professor told me when I asked him. Thanks again. – Virophage Oct 28 '21 at 04:07
0
XAML
<Window x:Class="WindowSample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="WPF Window Sample" Height="350" Width="525"
Name="FirstWindow" Icon="Icon1.ico" >
I believe all you have to do is add Icon=""
to your <Window>
In this example the custom icon file is in the project folder, and its named "Icon1.ico".
- Note that the icon image file has to be a
.ico
file. - Also note that the Icon file location can be changed to your preferences.
If you want even more help you should consider checking out this article.

Prabhdeep Singh
- 176
- 1
- 16
-
1thanks I will check that out. Little different then what I intended though. I am not using WPF, win forms instead; guess I could have said that. Thanks for the answer though, I will try as I am prolly going to recreate program in WPF for practice. – Virophage Oct 27 '21 at 17:45
-
@Virophage oh haha, I thought you already knew the original way to do it, and you needed a way to do it through xaml or something. Makes sense . – Prabhdeep Singh Oct 27 '21 at 17:49