Note that there are some explanatory texts on larger screens.

plurals
  1. POIcons don't work after publish
    primarykey
    data
    text
    <p>I have a simple application. When you click a button, the tasbar icon changes. When I Run this app from visual studio, everything works fine, but when I publish the WPF app, the taskbar Icon does not work (there is none).</p> <p>The build action is set to "embedded resource/copy always", I have tested "Resource" as well but it doesn't work.</p> <pre><code>var iconUri = new Uri("pack://application:,,,/images/internet_connection.ico", UriKind.RelativeOrAbsolute); this.Icon = BitmapFrame.Create(iconUri); </code></pre> <p>the icon in the top left corner of the frame changes, but the one in the taskbar doesn't.</p> <p>Can anyone help me please ?</p> <p>@Edit,</p> <p>I got it to work thanks to @Pavel's comment. But now one problem remains:</p> <p>When I run it in visual studio, and I do this:</p> <pre><code>var iconUri = UriHelper.GetUri(this.GetType(), "images/local_network.ico"); this.Icon = BitmapFrame.Create(iconUri); </code></pre> <p>The Icon changes. But with the published version, it doens't change.</p> <p>@@Edit,</p> <p>Ok so this is my code when I press a button:</p> <pre><code> var iconUri = UriHelper.GetUri(this.GetType(), "images/internet_connection.ico"); this.Icon = BitmapFrame.Create(iconUri); mNotifyIcon = new NotifyIcon { BalloonTipText = "The app has been minimised. Click the tray icon to show.", BalloonTipTitle = "The App", Text = "The App", Icon = BitmapFrame.Create(iconUri) }; BitmapImage image = new BitmapImage(); image.BeginInit(); image.UriSource = UriHelper.GetUri(this.GetType(), "images/internet_connection.png"); image.EndInit(); TaskbarItemInfo = new System.Windows.Shell.TaskbarItemInfo() { Overlay = image }; </code></pre> <p>what does it do: When running from VS: the icon in the taskbar changes, the overlay works, the icon in the top corner of the application changes.</p> <p>After build running the exe: the icon in the taskbar DOES NOT change, the overlay works, the icon in the top corner of the application changes.</p> <p>Can anyone explain this ?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload