Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

DependencyService and Referenced Projects

$
0
0

I've been attempting to create a class library for a set of services to be accessed in a Xamarin Forms application, using the DependencyService mechanism for each platform. I've been unable to successfully get it to work with having the actual implementations in their own project/DLL.

The structure I've been using is:
PCL Xam.Forms project
iOS/Android Xam Forms Project
PCL Interface/Definition for the services
iOS/Android specific implementation of the services

When I do this, it fails returning a null reference to the implementation from the platform library.

If I bring the implementation directly into the respective platform project (iOS/Android specifically at the moment) and leave the interface definition in it's separate project as above, it works without issue. Only when I have the platform definition in a separate project does it do this.

Are there any known issues with using DependencyService.Get() in this manner? Or any advice?

Thanks in advance!


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>