Reputation: 3253
I am developing a system where I want to share WCF Service logic between an Android app and an IOS app
I thought the best way of doing this was to create a PCL which I can reference in both
I have shared code which I have packaged up into a shared project.
This is referenced by my PCL. So far so good!
However, as soon as I reference this PCL in my IOS app I get a problem, it appears as though 2 versions of ILocation, one for PCL and one from my actual project.
Am I right in thinking that the only way around this is to have my WCF code in a I am experimenting with shared projects in Visual Studio 2013
I have an Interface ILocation which is included in my shared project
Upvotes: 0
Views: 317
Reputation: 940
You just have to move ILocation.cs from SharedProject into Pcl project. Files in SharedProject will still be able to access ILocation type because SharedProject files are actually part of Android and iOS project.
Shared project is nothing more then group of files that are linked(added) into project referencing shared project. This is same as if you would have some folder in your solution folder called SharedFiles and add links to files in this folder from other projects(Android, iOS..). Compiling this projects results into generating new IL(intermediate language code) for each of this projects and types are conflicting. If you ever used common AssemblyInfo.cs and used file linking for this... Well this is same only difference is that you don't have to reference new file in each project but only SharedProject.
Upvotes: 1