How to embed an application icon into application.exe
using WPF and F#? I did not find it anywhere.

- 4,191
- 2
- 28
- 54
-
[Here](https://stackoverflow.com/questions/26841947/changing-f-application-icon) you can see how to handle icons for WPF and F# – Wallace Kelly Jan 14 '19 at 21:33
2 Answers
I think the approach is the same for WPF and WinForms, which in F# means manually!
Please see this answer.
You could also looks at FsEye's source for reference (it's done in WinForms), see line 39 of http://code.google.com/p/fseye/source/browse/tags/1.0.0-final/FsEye/FsEye.fsproj, the file http://code.google.com/p/fseye/source/browse/tags/1.0.0-final/FsEye/IconResource.fs, and line 23 of http://code.google.com/p/fseye/source/browse/tags/1.0.0-final/FsEye/Forms/WatchForm.fs

- 1
- 1

- 22,107
- 9
- 81
- 136
-
You can add the icon to the project file using VS: just click Add New..., find the icon and remember to change the type to Embedded Resource. – Ramon Snir Sep 21 '11 at 13:07
(Update: link is no longer alive -- removed)
Quote:
"Make a .rc file with the following line: 1 ICON "icon.ico"
Then compile it with rc.exe and include the .res file in your project's properties page. You may also include .resources files in your project but the system will not pull the application icon from those."

- 3,069
- 1
- 17
- 26
-
This solution does not appear to work. Anyone have any success with this? I'm really stuck on this one. – battlebottle Feb 08 '14 at 15:31
-
2@battlebottle Yes. It works for me. What is the rc.exe output with /v key? If it writes something like "Writing GROUP_ICON:" and then unitelligible symbols you have a problem with UTF-8 signature. Simply delete the file and create it with echo command. rc.exe with /v key should write "Writing GROUP_ICON: 1" – Dmitry Feb 09 '14 at 13:55
-
1
-
@theimoswki Thanks for noticing. It was ok back then. I will remove it. – Dmitry Dec 18 '18 at 13:49