Run C# in .Net and iOS in Xamarin or Mono

walkerboxwalkerbox PLMember

For last few days I was looking for a solution, to have one C# code, that could be run in two existing projects (Windows Desktop WPF and iOS application). I wish I could build 2 libraries, one for iOS and one for .NET, with one C# code. Is it possible in Xamarin or Mono? I made some research and it looks like there is no such project type in Xamarin, that I could build a library. So Xamarin libraries can be included only in Xamarin.iOS (C#) projects :(. Is that true? Than I moved to mono, but it looks like there is no mono without Xamarin. Monodevelop no longer exists, but there is Xamarin Studio with the same story. Summarizing, is there any way to run one C# code (as a library) in iOS and .NET application?

Answers

  • GuyProvostGuyProvost CAMember ✭✭✭

    You should read about PCL (Portable Class Libraries) and their profiles. Also, .NET standards.

    They allow exactly what you are seeking

  • walkerboxwalkerbox PLMember

    But can I build an iOS library from PCL? Not only reference PCL in Xamarin.iOS, but build a real, native library from only PCL, excluding Xamarin.iOS?

Sign In or Register to comment.