0

My team has built a Xamarin.Forms application using VS2017. We are using a Shared project because one of our core functionalities requires ESRI mapping, and ArcGIS Runtime for Xamarin does not support anything but Shared projects at this time.

The next app that my boss wants should be fairly quick to develop if I can use the existing code we've already written for the first app. However, I don't see any way that I can reference that code from another project. I have tried adding a new UWP project to the existing one, but then I have to add all the same NuGet packages, 90% of which are unnecessary to this new project. On top of that, it won't actually compile correctly since the App.xaml is different.

I've searched all over trying to find a solution to this, and haven't come up with anything. PCL is not an option, nor is .NET Standard. Is there any way to accomplish this?

  • 3
    You can, but you probably need to extract the code you want to share into a separate shared project that both apps will then reference – Jason Aug 18 '18 at 01:32
  • In other words, create multiple App.UWP/App.iOS/App.Android projects around a single App.Shared project? That's the approach I was thinking about, but the references seem to be a little wonky. Should they all be housed in the same solution? – Captain Awesome Aug 18 '18 at 20:17
  • not quite. Each App will have a) 1 project for each platform you're supporting, b) 1 shared project containing the logic and UI for that App, and c) 1 shared project containing common code/UI for ALL the apps. Each platform project in a) will contain a reference to b) and c). Whether you use a single solution or multiple is up to you - solution files are really just ways to organize code. – Jason Aug 18 '18 at 20:50
  • Ok, that makes sense. I’ll give that a shot and see what happens. – Captain Awesome Aug 19 '18 at 01:20

0 Answers0