Wednesday, December 8, 2010

Migrating ESRI Business Analyst API from Silverlight 3 to Silverlight 4

When you install ArcGIS Silverlight API v2.1 and then try to use the ESRI Business Analyst API DLL (ESRI.ArcGIS.Client.BAO.dll) which is still (8 Dec 2010) version 1.1.0.97 then application will throw the following error. This error will appear when you attempt to authenticate with ESRI BAO API and get a token.
{System.Exception: Error processing task results ---> System.MissingMethodException: Method not found: 'System.Windows.Threading.Dispatcher ESRI.ArcGIS.Client.Tasks.TaskBase.get_Dispatcher()'.
   at ESRI.ArcGIS.Client.BAO.Tasks.AuthenticationTask.OnExecuteCompleted(AuthenticationEventArgs args)
   at ESRI.ArcGIS.Client.BAO.Tasks.AuthenticationTask.AuthenticationCompleted(Object sender, RequestEventArgs e)
   --- End of inner exception stack trace ---}
To avoid this error the best option is to use the Silverlight API DLLs which are version 1.2.0.177.
ESRI.ArcGIS.Client.dll
ESRI.ArcGIS.Client.Toolkit.dll
This was tested by migrating an old Visual Studio 2008 SP1 and Silverlight 3.0 Application to Visual Studio 2010 .NET Framework 4.0 and Silverlight 4.0.

All Blogs so far ...