ServiceStack DTOs on MonoTouch - xamarin.ios

We're creating a webservice with ServiceStack (current v3-fixes branch) and another company is programming an Android and iOS App against it.
My DTOs are (of course) in separate assemblies and compiled against .Net Framework 4. I can use these assemblies without problems in .Net projects and also in the Xamarin.Android project. The other company now told me, that they are not working in Xamarin.iOS.
They are using the latest (precompiled) ServiceStack.MonoTouch dlls with version 3.9.55. I read somewhere that I have to compile my DTOs against the MonoTouch version of the ServiceStack dlls.
Is this correct and is it possible to do this in a windows environment?
Thanks in advance
Steffen

Yes this is true you will need to compile your DTO's against the MonoTouch version of the ServiceStack dlls. The reason for this is because Xamarin.iOS does not support the full desktop version of the .NET assemblies. Rather it is a subset of them, much like the Silverlight platform. See here for more information.
Note: Xamarin.iOS is not ABI compatible with existing assemblies compiled for a different profile. You must recompile your source code to generate assemblies targeting the Xamarin.iOS profile (just as you need to recompile source code to target Silverlight and .NET 3.5 separately).
While Xamarin does have a Visual Studio plugin, Xamarin doesn't support Xamarin.iOS without a Mac OS X environment. There are services online where you can hire remote Mac OS X systems.

Related

Can I build and compile cross platform Xamarin apps on Linux?

I'm using Fedora 27 as my Operating System, and I'm wondering if I could get the Xamarin toolset working on it to create cross platform apps with an IDE like monodevelop, VS Code or Rider.
I heard Xamarin get's new templates for Xamarin.Forms for Linux, but I can't find any recent development news about that.
Yes, as of mid-2018, it is somewhat possible to develop a Xamarin.Forms app under MonoDevelop on Linux. I successfully managed to do it.
Basically, you need to have at least two things:
A shared library project, containing all the cross-platform Xamarin.Forms code and Xaml files. For some reason, on Linux this library project have to be compiled with .NET Core toolchain and not Mono toolchain (otherwise there is some GTK issues at runtime later on). The target framework is .NET Standard 1.0 or .NET Standard 2.0, and the main dependency is the NuGet package "Xamarin.Forms".
A Mono/GTK# platform-specific project for Linux, containing all the platform specific code: initialize GTK and Xamarin.Forms.Platform.GTK backend, and start the Xamarin.Forms code. The dependencies are the NuGet package "Xamarin.Forms.Platform.GTK", references to locally installed GTK# of your linux distribution (gtk-sharp, atk-sharp, etc...), and obviously a reference to the shared library project. Note that only GTK2 is supported and not GTK3.
The shared library project may be developed with MonoDevelop, Visual Studio, or JetBrains Rider. Note that with MonoDevelop, there is no XAML designer... so this is easier to do the design stuff with Visual Studio on Windows.
The platform specific project may be developed using MonoDevelop or Rider on Linux.
Here is a picture of the project structure under MonoDevelop:
There is a "HelloWorldXamarin" library project. It uses the .NET Core toolchain targeting .NET Standard 1.0, and have a dependency to NuGet package "Xamarin.Forms"
There is a "HelloWorldXamarin_Linux" project. It uses the Mono toolchain targeting Mono/GTK# for Linux, and have dependencies to GKT# and HelloWorldXamarin library, as well as dependency to NuGet package "Xamarin.Forms.Platform.GTK". You can see the platform specific code on the right.
And a picture of the result:
So you can now develop cross-platform Xamarin.Forms GUI applications for Windows,Mac,Linux,Android,iOS...
Yes you can and how well it will work on Fedora I'm not sure, but it looks like development is still in progress for the GTK Backend on Linux. For more information, there's a Github repo here that shows how far along it is and how you can try it yourself.

What is the importance of CoreCLR, PCL and WinRT in Azure-Storage-Net change log

I was inspecting the change log of Windows Azure Storage nuget from here. I do not get the usage of CoreCLR, PCL and WinRT.
For instance
Changes in 7.2.0 :
All (CoreCLR): NetStandard target framework changed to netstandard1.3
All (PCL): Removed support for PCL in favor of NetStandard GA release
...
Changes in 7.1.2 :
...
All (WinRT): Fixed a bug where HttpClient default timeout caused unhandled TaskCancellation exceptions.
...
A simple search on google tells that CoreCLR is a .NET execution engine and WinRT stands for Windows Runtime. I do not know what PCL is.
So what is the importance of these in change log in simple terms?
Those represent versions of the package capable of running on different versions of .Net:
WinRT is used in Windows Store apps, it uses a trimmed version of .Net
PCL is short for Portable Class Library, the old approach of targeting multiple versions of .Net from a single library
NetStandard is a new approach of targeting multiple versions of .Net, that came along with .Net Core, the new modular cross-platform version of .Net
CoreCLR is the runtime used by .Net Core, though marking changes to NetStandard version of the library as "CoreCLR" is confusing

Developing applications for Windows Embedded Compact 2013

Today I stumbled over the Application Builder for CE 2013 in Microsoft's download center. As of the description, with this pack I should be able to develop apps that target Windows Embedded Compact 2013 with Visual Studio 2012.
After downloading and installing the Application Builder I found the new framework assemblies in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsEmbeddedCompact\v3.9, but there are no project templates targeting Embedded Compact 2013 in Visual Studio 2012.
I tried to create a blank WinForms or WPF project and to retarget it to 3.9, but that doesn't seem to be possible as well. There are no online templates that could be installed.
How do I create a CF 3.9 application using Visual Studio 2012?
All I can do here is sigh. Here's the state of things as of this writing (Mid May, 2013) and it could change in the coming weeks and/or months.
The Application Builder does not ship with device templates. Templates, instead, are shipped with the device SDK. Yes, this is different than in the past. It means that to do any device development, you'll need an SDK.
Windows Embedded Compact 2013 is currently not publicly available, so no one can currently ship an SDK. The net effect of this is that, for now, for the general public, the Application Builder install is completely useless.
Once WEC 2013 is public, I don't believe Microsoft will be shipping any "generic" SDKs. I very likely will. Once we have SDKs in the wild, you'll have templates and be able to build projects.
I also downloaded the Application Builder, and found it quite useless, hey where are the compact project templates! (thanks for the confirmation ctacke) after reading this today and discovering the .net assembly folder posted by Gene, I figured I at least try to use the object browser - and found you can browse the objects by using the Windows Embedded Compact 3.9 filter - figure others might want to at least look at what's new like I am attempting to do..
It is possible to create new SDKs from OS Design projects.
Create one from CEPC.
http://msdn.microsoft.com/en-us/library/jj584864(v=winembedded.70).aspx

Can I reference .NET 4.0.3 runtime in MonoDevelop on a Mac?

In my question about using .NET 4.0.3 in a Portable Class Library I spoke a little too soon: I got the PCL working on my Windows machine, but now I can't get it working on the Mac. If the library is set to use .NET 4.03, I get compiler errors in MonoDevelop, saying that the framework is not supported. So I'm stuck on PCL for .NET 4.0, which is annoying because I need some features from 4.0.3.
So, is there a way to target .NET 4.0.3 in MonoTouch/MonoDevelop on the mac?
MonoDevelop (up through 3.0.6) is/was hard-coded to only work with PCL Profile1 (I think it was Profile1, anyway). As a workaround, you can try changing over to Profile1 and building that.
On MacOS, MonoDevelop simply links with MonoTouch (or Mono4Android) system assemblies and ignores the PCL profile constraints (other than verifying that the profile is Profile1). If MonoTouch has the 4.0.3 APIs that you are trying to use, then things will build fine.

MonoTouch: does it support MEF?

I am trying to port an existing c# .net application that is using MEF extensively to MonoTouch and MonoDroid. Does MonoTouch and MonoDroid support MEF?
Try using PocketMEF.
It is a subset of MEF that can run on PocketPC, WindowsCE, etc.
You will have to create a MonoTouch project from the source, because I would think there would be some minor changes to make it run in MonoTouch.
All the attributes and classes are named the same as standard MEF, you should only have to change a reference and a using statement with #if iPhone to get it working.
According to the list of MonoTouch assemblies and Monodroid assemblies, the MEF assembly (System.ComponentModel.Composition.dll) is not included.
It might still be possible to compile the MEF sources for these platforms, but this would probably require modifications to eliminate unavailable dependencies.

Resources