简体   繁体   中英

C# Visual Studio using the wrong .exe icon

I first added "icon1.ico" to my project under Properties->Application. When I build it my .exe had "icon1". After this I decided to change the icon to "icon2.ico", which I added in the same way and selected. The little icon beside the dropdown menu shows "icon2". However, when I build the project it still uses the old "icon1".

Then I removed the old icon from the project, and rebuilt. Still the same old icon. I then changed to the "default icon" in the dropdown (the dropdown only shows "icon2" and (default)) and rebuilt. The exe then has the default icon. Changing back again to "icon2", and the exe has got "icon1", dispite it not being in the project anymore.

How can this be?

I managed to find what was wrong. In my Solution I had 3 projects. For some reason, dispite being seleted as the startup project, all my cleaning and rebuilding attempt seemed not to affect the project with the wrong icon (this includes deleting the bin folder), the only project that was being build was one of the other two (the output still said 3 build successfull, with 0 up to date).

What solved it was to right click on the specific project and select rebuild, which applied the correct icon.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM