After adding Caliburn.Micro.Xamarin.Forms to Droid projects build fails #323

Closed
fenix2222 opened this Issue May 11, 2016 · 6 comments

Projects

None yet

3 participants

@fenix2222

I have added Caliburn.Micro.Xamarin.Forms nuget to 3 projects: PCL for Xamarin Forms, Droid and iOS and now my Droid project doesn't build, I get:

Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Caliburn.Micro.Platform.Core, Version=3.0.1.0, Culture=neutral, PublicKeyToken=8e5891231f2ed21f'. Perhaps it doesn't exist in the Mono for Android profile?

Looks like Caliburn.Micro.Platform.Core.dll is missing. Unfortunatelly, sample app in github doesn't use nuget package references it uses direct project references, so I cannot compare.

@nigel-sampson
Contributor

Is the package manager also bringing down and referencing the package Caliburn.Micro?

@nigel-sampson nigel-sampson added the bug label May 13, 2016
@fenix2222

@nigel-sampson Yes, that part is ok. I took a fork of this project, manually compiled it and manually added reference to Caliburn.Micro.Platform.Core.dll to all projects and problem goes away, so definitely an issue with Caliburn.Micro.Xamarin.Forms dependencies.

@nigel-sampson
Contributor

Ah ok, think I know the issue. In the actual platform projects (not the PCL) we're expecting you to add reference to the Caliburn.Micro package which will add the assembly. You'll need this package for CM to work properly anyway.

May be able to add platform specific dependencies to the xamarin forms package so when added to a non PCL project it also brings in Caliburn.Micro.

@fenix2222
fenix2222 commented May 13, 2016 edited

@nigel-sampson Yes, that one only has a dependency on Caliburn.Micro.Core. You should be able to change nuspec file with platform specific depepndency. See https://docs.nuget.org/create/nuspec-reference - "Specifying Dependencies in version 2.0 and above" via group depepndencies

@nigel-sampson
Contributor

Yup, we're already doing that in the Caliburn.Micro package. Frustrating part is not being able to declare multiple targetFramework for the same group.

We can declare the following with no framework for when added to the PCL. I don't want to specify the full framework here to ensure it matches against other PCL's easier.

<group>
  <dependency id="Caliburn.Micro.Core" version="[3.0.1]" />
  <dependency id="Xamarin.Forms" version="2.0.1.6505" />
</group>

We'll then need a lot of

<group targetFramework="win8">
  <dependency id="Caliburn.Micro" version="[3.0.1]" />
  <dependency id="Xamarin.Forms" version="2.0.1.6505" />
</group>

For each individual framework, this'll ensure that in a PCL we only include Caliburn.Micro.Core but includes Caliburn.Micro when in a platform, not nice we need to spam all the frameworks and will require some more maintenance as new frameworks get added.

@nigel-sampson nigel-sampson added this to the v3.0.2 milestone May 16, 2016
@pavelgronsky

I have the same problem. So, how I can resolve this bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment