windows ClickOnce 开始菜单图标

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2645570/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 14:17:13  来源:igfitidea点击:

ClickOnce start menu icon

c#.netwindowsdeploymentclickonce

提问by René Stalder

How do I set the icon for my start menu shortcut, when I deploy and install my application with ClickOnce?

当我使用 ClickOnce 部署和安装我的应用程序时,如何设置开始菜单快捷方式的图标?

Platform: Visual Studio 2010 Professional Beta 1

平台:Visual Studio 2010 Professional Beta 1

回答by RobinDotNet

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.)

单击应用程序选项卡。(我在这里假设是 C#。如果你在做 VB,如果它不同,请回帖,我会看看它是否相同。)

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)).

在页面中间,有一个“图标和清单”选项。
浏览以找到要使用的图标并选择它。
它需要位于项目的顶层文件夹中;我想当你选择它时它会把它放在那里。
该图标将与您的项目一起部署,并将在“开始”菜单中使用。(您可以仔细检查应用程序文件对话框——它应该在那里标记为 include(auto))。

You can set the icon on the forms to point to the same icon, and show it on all your forms too.

您可以将表单上的图标设置为指向同一个图标,并在您的所有表单上显示它。

回答by Aaron Peters

The question that led me to this thread was the following: How do I set the icon for my start menu shortcut when I deploy and install my application with ClickOnce? This is Rene's question as well.

导致我进入这个线程的问题如下:当我使用 ClickOnce 部署和安装我的应用程序时,如何设置我的开始菜单快捷方式的图标?这也是雷内的问题。

I did try the solution where one goes to the Application tab and in the middle of the page use the option for "icon and manifest". I made sure that the icon was in the various resource files. The icon appeared on my window form, but this failed to solve the problem: The start icon remained the default icon and did not change to my application's icon.

我确实尝试了一种解决方案,即转到“应用程序”选项卡并在页面中间使用“图标和清单”选项。我确保图标在各种资源文件中。图标出现在我的窗体上,但这并没有解决问题:开始图标仍然是默认图标,并没有更改为我的应用程序的图标。

It failed because there was another issue involved. The icon.ico file I had built for the form was 250x250 and 96px resolution. I rebuilt the application icon, which was located in the root folder, to 16x16 and 72px resolution. After doing this the Start Menu icon in Windows changed top my application's icon.

它失败了,因为涉及另一个问题。我为表单构建的 icon.ico 文件是 250x250 和 96px 分辨率。我将位于根文件夹中的应用程序图标重建为 16x16 和 72px 分辨率。执行此操作后,Windows 中的开始菜单图标更改为我的应用程序图标的顶部。

回答by Dave Tapson

If you have previously published the app with the default icon, you have to uninstall the app and reinstall to get the new icon to display correctly.

如果您之前使用默认图标发布了该应用程序,则必须卸载该应用程序并重新安装才能使新图标正确显示。