New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xamarin.Android Application does not recognize Paket Nuget packages #2396

Closed
DrifterApps opened this Issue Jun 6, 2017 · 8 comments

Comments

Projects
None yet
3 participants
@DrifterApps

DrifterApps commented Jun 6, 2017

Created 2 identical Xamarin.Android (7.1) applications on Visual Studio for Mac.

When I add any NuGet package directly from NuGet, the packages are recognized by the solution and can be built successfully.

When I add the same NuGet package using Paket. The packages are not recognized by the solution.

I tried both Paket version 4.8.7 and the latest beta 008.

With the other types of projects (libraries, PCL, etc) everything works as expected.

Any ideas??

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Jun 6, 2017

Member
Member

forki commented Jun 6, 2017

@DrifterApps

This comment has been minimized.

Show comment
Hide comment
@DrifterApps

DrifterApps Jun 7, 2017

TestPaket.zip

I created 2 projects in the solution, out of 3 packages, only 1 is recognized.

  • SimpleInjector (not recognized)
  • Xamarin.Android.Support.v4 (ok)
  • System.Reactive.Core (not recognized)

I also included the log from the paket add commands.

DrifterApps commented Jun 7, 2017

TestPaket.zip

I created 2 projects in the solution, out of 3 packages, only 1 is recognized.

  • SimpleInjector (not recognized)
  • Xamarin.Android.Support.v4 (ok)
  • System.Reactive.Core (not recognized)

I also included the log from the paket add commands.

@DrifterApps

This comment has been minimized.

Show comment
Hide comment
@DrifterApps

DrifterApps Jun 10, 2017

Hi,

I tried with version 5.0.0-rc003 and I still have the same issue.

DrifterApps commented Jun 10, 2017

Hi,

I tried with version 5.0.0-rc003 and I still have the same issue.

@matthid

This comment has been minimized.

Show comment
Hide comment
@matthid

matthid Jun 10, 2017

Member

@DrifterApps I'm not sure what to do to be honest. Do you get any warning/error or what do I have to do exactly? I have no Mac btw.

Member

matthid commented Jun 10, 2017

@DrifterApps I'm not sure what to do to be honest. Do you get any warning/error or what do I have to do exactly? I have no Mac btw.

@DrifterApps

This comment has been minimized.

Show comment
Hide comment
@DrifterApps

DrifterApps Jun 10, 2017

@matthid I'm not sure what to tell you besides that I'm not getting any errors.

I did a test (which worked) by manually adding MonoAndroid to my target for SimpleInjector version .NETStandard 1.3 because that is the version being reference when I install the package using NuGet.

I manually added this reference:
($(TargetFrameworkIdentifier) == 'MonoAndroid') Or

Is it as though Paket cannot determine that the TargetFrameworkIdentifier MonoAndroid should be added and where...

  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.0.3')">
      <ItemGroup>
        <Reference Include="SimpleInjector">
          <HintPath>..\packages\SimpleInjector\lib\net40\SimpleInjector.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7')">
      <ItemGroup>
        <Reference Include="SimpleInjector">
          <HintPath>..\packages\SimpleInjector\lib\net45\SimpleInjector.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhoneApp') Or ($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v1.2')) Or ($(TargetFrameworkIdentifier) == 'WindowsPhone' And ($(TargetFrameworkVersion) == 'v8.0' Or $(TargetFrameworkVersion) == 'v8.1'))">
      <ItemGroup>
        <Reference Include="SimpleInjector">
          <HintPath>..\packages\SimpleInjector\lib\netstandard1.0\SimpleInjector.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="($(TargetFrameworkIdentifier) == 'MonoAndroid') Or ($(TargetFrameworkIdentifier) == '.NETCore' And $(TargetFrameworkVersion) == 'v5.0') Or ($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.3' Or $(TargetFrameworkVersion) == 'v1.4' Or $(TargetFrameworkVersion) == 'v1.5' Or $(TargetFrameworkVersion) == 'v1.6' Or $(TargetFrameworkVersion) == 'v2.0')) Or ($(TargetFrameworkIdentifier) == '.NETCoreApp' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v2.0'))">
      <ItemGroup>
        <Reference Include="SimpleInjector">
          <HintPath>..\packages\SimpleInjector\lib\netstandard1.3\SimpleInjector.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>

DrifterApps commented Jun 10, 2017

@matthid I'm not sure what to tell you besides that I'm not getting any errors.

I did a test (which worked) by manually adding MonoAndroid to my target for SimpleInjector version .NETStandard 1.3 because that is the version being reference when I install the package using NuGet.

I manually added this reference:
($(TargetFrameworkIdentifier) == 'MonoAndroid') Or

Is it as though Paket cannot determine that the TargetFrameworkIdentifier MonoAndroid should be added and where...

  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.0.3')">
      <ItemGroup>
        <Reference Include="SimpleInjector">
          <HintPath>..\packages\SimpleInjector\lib\net40\SimpleInjector.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7')">
      <ItemGroup>
        <Reference Include="SimpleInjector">
          <HintPath>..\packages\SimpleInjector\lib\net45\SimpleInjector.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhoneApp') Or ($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v1.2')) Or ($(TargetFrameworkIdentifier) == 'WindowsPhone' And ($(TargetFrameworkVersion) == 'v8.0' Or $(TargetFrameworkVersion) == 'v8.1'))">
      <ItemGroup>
        <Reference Include="SimpleInjector">
          <HintPath>..\packages\SimpleInjector\lib\netstandard1.0\SimpleInjector.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="($(TargetFrameworkIdentifier) == 'MonoAndroid') Or ($(TargetFrameworkIdentifier) == '.NETCore' And $(TargetFrameworkVersion) == 'v5.0') Or ($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.3' Or $(TargetFrameworkVersion) == 'v1.4' Or $(TargetFrameworkVersion) == 'v1.5' Or $(TargetFrameworkVersion) == 'v1.6' Or $(TargetFrameworkVersion) == 'v2.0')) Or ($(TargetFrameworkIdentifier) == '.NETCoreApp' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v2.0'))">
      <ItemGroup>
        <Reference Include="SimpleInjector">
          <HintPath>..\packages\SimpleInjector\lib\netstandard1.3\SimpleInjector.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>

@matthid

This comment has been minimized.

Show comment
Hide comment
@matthid

matthid Jun 10, 2017

Member

Ah so paket is not recognizing that SimpleInjector is compatible with monoandroid. Yes we miss the corresponding entries in paket.

Member

matthid commented Jun 10, 2017

Ah so paket is not recognizing that SimpleInjector is compatible with monoandroid. Yes we miss the corresponding entries in paket.

@DrifterApps

This comment has been minimized.

Show comment
Hide comment
@DrifterApps

DrifterApps Jun 10, 2017

Yes but just to be clear it's not just SimpleInjector... most packages I install do not get recognized unless they are specifically designed for MonoAndroid.

DrifterApps commented Jun 10, 2017

Yes but just to be clear it's not just SimpleInjector... most packages I install do not get recognized unless they are specifically designed for MonoAndroid.

@matthid

This comment has been minimized.

Show comment
Hide comment
@matthid

matthid Jun 10, 2017

Member

Yep I'm fixing that right now :). At least portable packages should work already. Just netstandard ones are currently not working.

Member

matthid commented Jun 10, 2017

Yep I'm fixing that right now :). At least portable packages should work already. Just netstandard ones are currently not working.

matthid added a commit that referenced this issue Jun 10, 2017

matthid added a commit that referenced this issue Jun 10, 2017

@matthid matthid closed this in #2411 Jun 10, 2017

matthid added a commit that referenced this issue Jun 10, 2017

Merge pull request #2411 from fsprojects/fix_2396
make xamarin stuff work with netstandard (#2396).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment