justcla / HotTips

Visual Studio extension that provides Tip of the Day
MIT License
3 stars 9 forks source link

Like button image is incorrectly linked, crashing VS #43

Open AmadeusW opened 6 years ago

AmadeusW commented 6 years ago

When I debug another extension than HotTips, VS crashes with the following message:

System.IO.DirectoryNotFoundException: 'Could not find a part of the path 'C:\src\surround\Surround.VS\bin\Debug\Tips\images\Like.png'.'

where \Tips\images\Like.png comes from the HotTips extension, and C:\src\surround is another VS extension. This leads me to believe that HotTips is trying to access "Like.png" from the arbitrary location of currently active extension, which HotTips is not when I'm not debugging it. The fix will likely entail correctly packaging and using the resources.

justcla commented 6 years ago

Deep.

AmadeusW commented 6 years ago

The code is in TipOfTheDayWindow.xaml.cs: new BitmapImage(new Uri("Tips/images/Like.png", UriKind.Relative)); <- this tries to load a file from current running directory. Instead, the BitmapImage needs to load the resource. The images itself should not use the "copy to output directory" property since they will be embedded

justcla commented 6 years ago

I'm getting this when running in normal (non-debug) mode:

image

justcla commented 6 years ago

@prafullbhosale Any ideas?

AmadeusW commented 6 years ago

yeah that's the issue. The bug is fixed through #50, although this is not the correct fix. Ultimately, we want to consume these images as assembly resources.