如何更改 Visual Studio 中控制台应用程序的图标?
我正在 VS 2008 中开发 C# 控制台应用程序,无法更改图标文件。
我在 project
-->properties
-->application
选项卡中更改了图标文件,但旧图标仍然与新版本一起显示。
检查了帖子中的以下答案以修改 .resx 文件。但我的应用程序只有一个 .cs
文件,而 .resx 文件
为空。
I am working on C# Console App in VS 2008 and am unable to change the icon file.
I changed the icon file in project
-->properties
-->application
tab but still the old icon is displaying with the new build.
Checked the below answer from a post to modify the .resx file. But my app has got only one .cs
file and the .resx file
is empty.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您更改图标时,项目的“属性”窗口是否看起来像这样?
确保重新编译(您可能需要清理您的首先解决方案,然后重建),然后您在正确的文件夹中搜索新构建的可执行文件。如果您在调试模式下进行编译,则默认文件夹为(从项目文件夹的根级别开始):
\bin\Debug
。如果您在发布模式下编译,它将位于\bin\Release
中。按照上述步骤,这对我来说效果很好。我新创建的“ConsoleApplication1”获得了一个漂亮的绿皮书图标:
>确保您正在查看正确的文件!只有您的可执行文件 (.EXE) 才会接受自定义图标处理。名称中包含“vshost”的文件由 Visual Studio 使用,其他文件包含调试信息等。此外,.DLL 文件无法显示自定义图标 - Windows 对所有 DLL 使用相同的图标,通常看起来像这样一张纸上的两个齿轮。
如果您仍然没有任何运气,您可以用有关您正在做的事情的更多详细信息来更新您的问题吗?否则我无法重现您遇到的问题。
When you change the icon, does your project's Properties window look something like this?
Make sure that you recompile (you might need to clean your solution first and then rebuild), and then that you're searching in the correct folder for your newly-built executable. If you're compiling in Debug mode, the default folder is (starting from the root level of your project's folder):
\bin\Debug
. If you're compiling in Release mode, it will be in\bin\Release
.Following the above steps, this works fine for me. My newly-created "ConsoleApplication1" gets a beautiful green book icon:
Make sure that you're looking at the right file! Only your executable (.EXE) is going to receive the custom icon treatment. The file that contains "vshost" in its name is used by Visual Studio, and the other files contain debug information, etc. Additionally, .DLL files cannot show custom icons—Windows uses the same icon for all DLLs and it usually looks something like two gears on a piece of paper.
If you still aren't having any luck, can you update your question with more details about what you're doing, specifically? I can't reproduce the problems you're experiencing otherwise.
我有同样的问题。
尝试删除 C:\Users\\AppData\Local\IconCache.db 后
新图标按预期显示。
您可以按照以下步骤尝试:https://superuser.com/a/499083
I have the same problem.
After trying to delete C:\Users\\AppData\Local\IconCache.db
the new icon is shown as expected.
You can try it follow steps at: https://superuser.com/a/499083