I am working on a Silverlight project, and recently someone on my team added var popups = VisualTreeHelper.GetOpenPopups() to a method in our app. When I got their code from source control I got a compile error saying that GetOpenPopups wasn’t found on VisualTreeHelper. VisualTreeHelper is an object coming from the System.Windows.Media namespace, and there is no difference between my code file (for this file) and that of the rest of my team. In the object browser I can see that in the System.Windows assembly under the System.Windows.Media namespace, the GetOpenPopups method is not listed for me, but it is for the rest of my team. It appears that somehow we have different versions of these assemblies, but there are no warnings about reference versions being incorrect from the project/solution.
What am I missing here? Why is GetOpenPopups() missing for me (and not the rest of my team)?
On a hunch I downloaded and installed the most recent version of the Silverlight SDK (no code change within the project), and now the method is showing up on VisualTreeHelper. Aparently
GetOpenPopupsis a recently added method (as of Silverlight 4). I thought I had installed the SDK before, and we have been developing against Silverlight 4 since the start of our project about a year ago, so I am still confused as to why it wasn’t available on my machine. There were no warnings or errors about versions being different from what was available on my machine and what was referenced in our project. Looks like I might need to read up on versioning in .NET assemblies to better understand how it works and to make sure this won’t be an issue at deployment. Thanks for the suggestions guys.