I made a WPF application (.net core 3.1) and then towards the end I wanted to change the icon, as usual I opened the properties>application and loaded my icon. But it doesn't change anything... remains the same default icon.
The size of my icon is 256x256 and obviously has an .ico format. I tried to delete the folder where the executable is located and to build again, I also tried to run the application without debugging mode, but nothing. I noticed, however, that the main window when you change the Icon attribute updates the window icon. But nothing to do for the .exe file.
Does anyone know how to solve this problem?
P.S. I don't think it's the icon the problem because I tried to load another icon that I used in the past with another WPF application
Right click on your solution in Solution Explorer and click on "Rebuild Solution" or "Clean Solution" followed by "Build Solution".
Related
Tried example for set icon in ClickOnce installation, but get no progress. In publish->Options->File Associations set extension for .application and selected my icon. Maybe i looking for wrong way to set icon, but my app.appref-ms still have default icon.
Context menu on project-> Properties -> Tab Application -> TextBox Icon
Have you tried reinstalling the app, source: ClickOnce start menu icon. There are many solutions provided by the contributers of the aforementioned source, some indicating that it might be in the size of the icon.ico file or that the file wasn't marked included prior to the deployment. Hopefully you'll find your answer there.
Is there any way to set custom icon for setup.exe file when publishing through VS for click once publish.
Always after publishing, I am getting setup.exe file and with the icon (kind of black disc image) but after installing the application, I can see my custom logo on the startmenu,ctrlpanel.
I'm not aware of any way to change the icon BEFORE building the project so that once the ClickOnce is deployed it already has the icon, however you can edit the setup.exe icon AFTER deployment quite easily. If anyone else knows of a way to do it before then they can trump my answer.
In Visual Studio go to File > Open > File and browse to the setup.exe for your ClickOnce deployment. Open this file.
You should see a folder tree. Right click on the Icon node and choose Add Resource.
It should already have the Icon resource type chosen on the left so click Import on the right to add your icon.
Your icon will open up in Visual Studio, just close this tab. You should be back to your folder tree. Look under the Icon node and make sure your icon has the lowest ID number.
Save the file.
Your setup.exe will now have the new icon.
Disclaimer: For me Windows was weird and didn't refresh the icon right away. If I went to its properties or copied the file elsewhere I could see the icon immediately. I imagine it's a caching thing.
Edit: Screenshot:
Double-click on the properties for your main project.
Click on the Application tab. (I'm assuming C# here. If you're doing VB, post back if it's different and I'll see if it's the same.)
In the middle of the page, there is an option for "icon and manifest".
Browse to find the icon you want to use and select it.
It needs to be in the top folder of your project; I think it will put it there when you select it.
The icon will be deployed with your project, and will be used in the Start Menu. (You can doublecheck the Application Files dialog -- it should be in there marked include(auto)).
You can set the icon on the forms to point to the same icon, and show it on all your forms too.
this link got your answer:
ClickOnce start menu icon
I need to brand a specific white labeled app and it needs to get the appropriate app icon, so that when I browse to the exe in file explorer it shows with the branded icon. I dont mean changing the icon at runtime because that is not a problem.
I have tried accessing the assemblies with mono.cecil and replacing the resource called "app.ico" but it doesnt seem to work. I also tried to use pack URIs in xaml but that doesnt work because at compile time I dont know where the branding resources are located.
I know that this can possibly be done during a pre-build event but I prefer replacing the icon after the exe is built.
Any ideas?
In the 'Solution Explorer' in Visual Studio, select the startup project. Either right click on it and select 'Properties', or just press Alt+Enter on the keyboard to open the project properties. On the 'Application' tab, you should see a 'Resources' section. Click on the 'Icon and manifest' and select an icon for your application. Is that what you were talking about?
For some reason, a very old version of my icon keeps showing up when my application is dropped on the desktop. In the windows explorer (in all zooming levels) the icons is correctly the assembly icon. I specified the correct item in both XAML Window.Icon and in the project settings.
I have deleted the old version of my icon from all folders I can think of, but it still shows up. Also while drag and dropping, the wrong icon is shown. (in the slightly transparent preview window)
I tried cleaning and rebuilding, I tried deleting the obj folder manually...
The original, wrong icon was 16x16. I have built the new version as 32x32, because on the desktop 16x16 is too small.
According to the msdn docs (http://msdn.microsoft.com/en-us/library/system.windows.window.icon.aspx), each .ico file is supposed to incorporate all smaller sizes anyway.
I also checked that I changed the icon for both debug and release configuration.
Thanks for any ideas! :)
Could this be a problem with the IconCache? Try deleting %localappdata%\IconCache.db and restarting Explorer.exe.
Check the Visual Studio properties window for the EXE's project -- you can specify the icon that's written into the EXE at compile time. This is separate from the icon that's assigned to the XAML window at run time.
I am working on a Wpf desktop application, whenever i run my application it shows me a window and associated tab in the task bar(Normal windows feature). My problem is that the tab is using window's icon for unknown file-type, I tried with Icon property of Window, Icon gets assigned but still problem is when I run application, task bar Tab initially displays window's icon for unknown file-type and when window-load completes it changes to the Icon assigned. I want Icon there from beginning. Any help?
Edit:
I tried with .csproj --> Properties --> Application Tab --> Icon
and set it to a .ico file. It works but I need to run my application by .exe file. It doesn't work in development environment(while running through visual studio). I need to set Start-Project option then. Is there any other way to solve this problem?
Check the properties of your main Window project.. You should be able to set an icon there.
Update:
Is it such a problem that your icon does not show in debug mode? As long as it works when you deliver the program to your customer, its all alright, not?
On a side note: You could check some things though. Perhaps your icon is not included in your project, or it isnt copied when building to your Debug folder?
Update 2:
You also need to set the Main Form's Icon for it to show in Debug. If you also set the icon for the main form, it will display in the Taskbar during Debug / Runtime.
I had a similar issue and google led me to this article. I forgot one simple thing, and that was my Main Form's Icon. If you also set the icon for the main form, it will display in the Taskbar during Debug / Runtime.
For WPF applications, use the attribute
Icon="Images\Logo.ico"
for the Window element in XAML to have the window show the icon.
I know this is old, but I found that I could get the icon to show in the taskbar in Debug mode if I went to the project's properties and checked the "Enable native code debugging" box on the "Debug" page
That worked for me. In a VB application, go to Debug screen of Project options (of the UI project) and select Enable unmanaged code debugging. Not sure if there are any negative side effects, but it sure showed the icon during debug. Thanks.
This is old but you can also change the shortcut icon in the setup projet, this is what worked for me (when viewing file system by right clicking the setup project).