title: Xamarin Multiple framework target
body: <p>Good morning</p>
  <p>I am building package for Xamrin.Forms. I follow how its done by <a href="https://github.com/jamesmontemagno/GeolocatorPlugin/tree/master/src/Geolocator.Plugin" rel="nofollow noreferrer">James Montenango</a></p>
  <p>Here are some important pieces of my .csproj</p>
  <pre><code>&lt;TargetFrameworks&gt;netstandard2.0;MonoAndroid10.0;Xamarin.iOS10&lt;/TargetFrameworks&gt;
  
    &lt;ItemGroup&gt;
      &lt;Compile Include=&quot;**\*.shared.cs&quot; /&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup Condition=&quot; $(TargetFramework.StartsWith('netstandard')) &quot;&gt;
      &lt;PackageReference Include=&quot;XTricks.Shared&quot; Version=&quot;1.0.1&quot; /&gt;
      &lt;PackageReference Include=&quot;Xamarin.Essentials&quot; Version=&quot;1.6.1&quot; /&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup Condition=&quot; $(TargetFramework.StartsWith('MonoAndroid')) &quot;&gt;
      &lt;PackageReference Include=&quot;Xamarin.Forms&quot; Version=&quot;5.0.0.2196&quot; /&gt;
      &lt;PackageReference Include=&quot;Xamarin.GooglePlayServices.Location&quot; Version=&quot;118.0.0.1&quot; /&gt;
      &lt;PackageReference Include=&quot;XTricks.Shared&quot; Version=&quot;1.0.1&quot; /&gt;
      &lt;PackageReference Include=&quot;Xamarin.Essentials&quot; Version=&quot;1.6.1&quot; /&gt;
      &lt;Compile Include=&quot;**\*.android.cs&quot; /&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup Condition=&quot; $(TargetFramework.StartsWith('Xamarin.iOS')) &quot;&gt;
      &lt;PackageReference Include=&quot;Xamarin.Essentials&quot; Version=&quot;1.6.1&quot; /&gt;
      &lt;PackageReference Include=&quot;XTricks.Shared&quot; Version=&quot;1.0.1&quot; /&gt;
      &lt;Compile Include=&quot;**\*.apple.cs&quot; /&gt;
    &lt;/ItemGroup&gt;
  </code></pre>
  <p>Everything is working except one important thing.
  I would like to have two implementation of the same class for Android and for iOS.</p>
  <p>For this purpose I declare and interface as:</p>
  <pre><code>IMyService.shared.cs
  </code></pre>
  <p>And I create two classes, one in Android folder called:
  MyService.android.cs which implements IMyService.shared.cs
  and second in Apple folder called MyService.apple.cs.</p>
  <p>Now as is done in above library I would like to use service in shared code.</p>
  <pre><code>        private static IMyService Service
          {
              get
              {
  #if NETSTANDARD1_0 || NETSTANDARD2_0
                  return null;
  #else
                  return new MyService(); // And this code is red one. MyService cannot be found. 
  #endif
              }
          }
  </code></pre>
  <p>Basically I am stucked there. Does anyone know how to move foward?</p>