Recently we've encountered some problems when compiling a .NET 3.0 application in Visual Studio 2005. The weird thing was that we could compile and run the application on our local machines, but the build computer we used refused to compile the application due to the simple fact that the code wouldn't compile. It called methods that existed, but an overload was used that didn't exist.
The local computer and the build computer had a 3.0 Framework or higher installed. Both had the same Visual Studio 2005 installed. Both had the same service packs installed. We just couldn't figure out what was different on those machines.
It turned out that the local computer had only a 3.5 Framework installed. All references in the project were to the 3.0 Framework, so everything compiled just fine. But Intellisense reads the metadata from the actual assebly being referenced, which was on the build computer the 3.5 assemblies. So on the build computer we had these overloads of Dispatcher.Invoke, all coming from the 3.0 assemblies:
Dispatcher.Invoke (DispatcherPriority, Delegate)
Dispatcher.Invoke (DispatcherPriority, Delegate, Object)
Dispatcher.Invoke (DispatcherPriority, TimeSpan, Delegate)
Dispatcher.Invoke (DispatcherPriority, Delegate, Object, Object[])
Dispatcher.Invoke (DispatcherPriority, TimeSpan, Delegate, Object)
Dispatcher.Invoke (DispatcherPriority, TimeSpan, Delegate, Object, Object[])
But on the local machine with only the 3.5 Framework we had these overloads:
Invoke(DispatcherPriority, Delegate)
Invoke(Delegate, array<Object>[]()[])
Invoke(DispatcherPriority, Delegate, Object)
Invoke(DispatcherPriority, TimeSpan, Delegate)
Invoke(Delegate, TimeSpan, array<Object>[]()[])
Invoke(Delegate, DispatcherPriority, array<Object>[]()[])
Invoke(DispatcherPriority, Delegate, Object, array<Object>[]()[])
Invoke(DispatcherPriority, TimeSpan, Delegate, Object)
Invoke(Delegate, TimeSpan, DispatcherPriority, array<Object>[]()[])
Invoke(DispatcherPriority, TimeSpan, Delegate, Object, array<Object>[]()[])
So if we used any overload from the latter list that is not in the first list, it'd not compile on the build computer. So, programmer beware: an application built in VS2005 might not compile in VS2005.