latest posts

Had an unusual experience this morning when attempting to deploy an iOS MonoTouch app to a local iMac instead of the one I had previously done over the VPN from home to my office. The Build Server Icons on the Visual Studio 2012 Command Bar were all greyed out and for the life of me I could not find a context menu to have it refresh the available build hosts. Some digging into the documentation, the actual option is under TOOLS -> Options... -> Xamarin -> iOS Settings like so: [caption id="attachment_1930" align="aligncenter" width="300"]Xamarin iOS Settings in Visual Studio 2012 Xamarin iOS Settings in Visual Studio 2012[/caption] Once on that dialog, click "Configure..." and then you'll get a dialog like so, and click on the Mac you wish to deploy to: [caption id="attachment_1931" align="aligncenter" width="300"]Xamarin iOS Build Host Xamarin iOS Build Host[/caption]
Ran into a fun MonoTouch error inside of Visual Studio 2012 today: [caption id="attachment_1877" align="aligncenter" width="550"]Could not load file or assembly 'moscorlib' Could not load file or assembly 'moscorlib'[/caption] Oddly enough, it only started doing that prior to a successful remote deployment. The solution is to go into your Visual Studio 2012 project properties, Build Tab and switch Generate serialization assembly to off. [caption id="attachment_1878" align="aligncenter" width="661"]Visual Studio 2012 Generate Serialization Assembly Dropdown Visual Studio 2012 Generate Serialization Assembly Dropdown[/caption]
For the last 2.5 years I've been using the default MonoDevelop Web Reference in my MonoTouch applications for work, but it's come to the point where I really need and want to make use of the WCF features that I do in my Windows Phone applications. Even with the newly released iOS Integration in Visual Studio 2012, you still have to generate the proxy class with the slsvcutil included with the Silverlight 3.0 SDK. If you're like me, you probably don't have Version 3.0 of the Silverlight SDK, you can get it from Microsoft here. When running the tool you might get the following error: Error: An error occurred in the tool. Error: Could not load file or assembly 'C:\Program Files (x86)\Microsoft Silverl ight\5.1.10411.0\System.Runtime.Serialization.dll' or one of its dependencies. T his assembly is built by a runtime newer than the currently loaded runtime and c annot be loaded. Basically the tool is incorrectly trying to pull the newer 4.0 or 5.0 Silverlight Assemblies, to make it easy, I created a config file to simply drop into your c:\Program Files (x86)\Microsoft SDKs\Silverlight\v3.0\Tools folder, you can download it here. From a command line (remember the shortcut to hold shift down and right click in the folder to open a command prompt): [caption id="attachment_1853" align="aligncenter" width="593"]Silverlight 3 WCF Proxy Generation Silverlight 3 WCF Proxy Generation[/caption] Enter the following, assuming you want to create a proxy for a localhost WCF Service to your c:\tmp folder: SlSvcUtil.exe http://localhost/Service.svc?wsdl /noconfig /d:c:\tmp Though I should note, this will generate Array collections and not List or ObservableCollection collections. If you want to generate your Operation Contracts with return types of those collections simply add for List Collections: /collectionType:System.Collections.Generic.List`1 or ObservableCollection: /collectionType:System.Collections.ObjectModel.ObservableCollection`1