I am building an application that interacts with SharePoint 2010. It is a Silverlight application built on the Managed Client Object Model.
The application is set up on SharePoint like this: User takes the .XAP file and uploads it to some SharePoint document library. Next, he or she adds a new Silverlight web part to some page and directs that web part to use the .XAP file. Once that is done and the page is opened, the Silverlight application is loaded and ready to run.
As we all know, SharePoint Managed Client Object model cannot interact with SharePoint 2007. I need to be able to handle the scenario in which the user mistakenly sets up the application on a SharePoint 2007 page. I want my application to realize that it is supposed to work with the wrong version of SharePoint and to throw an Exception.
How can I determine the SharePoint version using the Managed Client Object Model? Thanks.