I am using TaskBar methods defined in the Microsoft.WindowsAPICodePack.Taskbar namespace. In particular, I will focus on SetProgressState for this question.
Here is the meta definition I get when I define the SetProgressState definition:
namespace Microsoft.WindowsAPICodePack.Taskbar { public class TaskbarManager { public void SetProgressState(TaskbarProgressBarState state); public void SetProgressState(TaskbarProgressBarState state, IntPtr windowHandle); public void SetProgressState(TaskbarProgressBarState state, System.Windows.Window window); } }
Obviously, I missed most of this class definition to highlight only one overload method.
At this point, I used one-parameter overload and had no problems. However, today I tried using two-parameter overload, which takes IntPtr as its second parameter.
When I did this, I started getting this error during build:
The type "System.Windows.Window" is defined in an assembly that is not a reference. You must add a reference to the assembly 'PresentationFramework, Version = 3.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35'
So my question is, why didnโt I get an error for using one-parameter overload, but I get an error message to refer to one of the others (and to the wrong one)?
Edit (for additional subquery):
I also tried the following, which didn't matter:
SetProgressState(myState, (IntPtr) myWindowHandle);
I thought that I would explicitly abandon the compiler's confusion about implementing the corresponding overload, but that was not the case.