简体   繁体   English

如何为ClickOnce部署设置.application图标(仅在线)

[英]How do I set the .application icon for a ClickOnce deployment (online only)

I have a clickonce application that I would like to have the ApplicationName.application file have an icon for the application. 我有一个clickonce应用程序,我希望ApplicationName.application文件具有该应用程序的图标。 Currently the ApplicaitonName.applicaiton file has the default window with blue top and green arrow standard icon. 当前,ApplicaitonName.applicaiton文件具有带有蓝色顶部和绿色箭头标准图标的默认窗口。

I have an application icon under the application setup, resources, icon and manifest. 我在应用程序设置,资源,图标和清单下有一个应用程序图标。 That application icon is set to content (i have also tried with it set to embedded resource). 该应用程序图标设置为内容(我也尝试将其设置为嵌入式资源)。 That application icon shows up as the window icon and toolbar icon for the application when it is running. 该应用程序图标在运行时显示为该应用程序的窗口图标和工具栏图标。

Under publish I publish to a UNC Path and have the "The application is available online only" radio button clicked. 在发布下,我发布到UNC路径,并单击了“该应用程序仅可在线使用”单选按钮。 Under Application Files the Resources\\ApplicationIcon.ico is Publish Status: Include (Auto), Download Group: (Required), Hash: Include (if the icon is embedded resource it is not in the Application Files). 在“应用程序文件”下,Resources \\ ApplicationIcon.ico为“发布状态”:“包含”(自动),“下载组”:“(必需)”,“哈希”:“包含”(如果图标是嵌入式资源,则不在“应用程序文件”中)。

I generally open the UNC Path and create a shortcut to the .application file to run the application then. 我通常打开UNC路径并创建.application文件的快捷方式,然后运行该应用程序。 I just want that .application file to have the same icon as the windows and toolbar, but not sure what else i need to do to accomplish that. 我只希望该.application文件具有与窗口和工具栏相同的图标,但不确定要实现该目标还需要做什么。 Any help is much appreciated. 任何帮助深表感谢。

The .application file is the deployment manifest. .application文件是部署清单。 I don't think you can add an icon in that file. 我认为您不能在该文件中添加图标。 Why should it matter to have the default window icon as it is not seen by the client if hosted in IIS. 为什么拥有默认窗口图标会很重要,因为如果托管在IIS中,则客户端不会看到它。
On the other hand you can definitely add an icon to the appplication manifest (the .manifest file) and this icon is what shown on the start menu and in the application. 另一方面,您可以肯定地将一个图标添加到应用程序清单(.manifest文件)中,并且该图标就是开始菜单和应用程序中显示的图标。 The .manifest file should look like .manifest文件应该看起来像

<asmv1:assembly .. />
  <description asmv2:iconFile="custom.ico" xmlns="urn:schemas-microsoft-com:asm.v1" />
 ...  

In my msbuild script I use the GenerateApplicationManifest task to set the IconFile 在我的msbuild脚本中,我使用GenerateApplicationManifest任务来设置IconFile

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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