1
votes

I Have a .NetStandard 1.4 Library that referenced from another Xamarin.Forms .NetStandard 1.4 Library.

First Library :

{
  "supports": {},
  "dependencies": {
    "Microsoft.NETCore.Portable.Compatibility": "1.0.2",
    "NETStandard.Library": "1.6.1",
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.1"
    "AutoMapper": "6.0.2",
    "Microsoft.AspNetCore.DataProtection": "1.1.1",
    "Microsoft.EntityFrameworkCore": "1.1.1",
    "System.Xml.XmlDocument": "4.3.0"
  },
  "frameworks": {
    "netstandard1.4": {}
  }
}

Xamarin.Forms Library :

{
  "supports": {},
  "dependencies": {
    "Microsoft.NETCore.Portable.Compatibility": "1.0.2",
    "NETStandard.Library": "1.6.1",
    "Xamarin.Forms": "2.3.4.231",
    "Xamarin.Forms.CarouselView": "2.3.0-pre2"
  },
  "frameworks": {
    "netstandard1.4": {
      "imports": "portable-net461"
    }
  }
}

IOS is working fine. Android after adding some packages also working fine. My problem is UWP. It drives me crazy. This is UWP project.json :

{
  "dependencies": {
    "Microsoft.NETCore.UniversalWindowsPlatform": "5.3.2",
    "Xamarin.Forms": "2.3.4.231",
    "Xamarin.Forms.CarouselView": "2.3.0-pre2"
  },
  "frameworks": {
    "uap10.0": {}
  },
  "runtimes": {
    "win10-x86": {}
  }
} 

I have 4 error :

Invalid Resx file. Stream is not a valid resource file. Eella.Xamarin.Taxi.UWP C:\Users.....nuget\packages\Microsoft.AspNetCore.DataProtection.Abstractions\1.1.1\lib\netstandard1.3\Microsoft.AspNetCore.DataProtection.Abstractions.dll

.

Invalid Resx file. Stream is not a valid resource file. Eella.Xamarin.Taxi.UWP C:\Users....nuget\packages\Microsoft.AspNetCore.WebUtilities\1.1.1\lib\netstandard1.3\Microsoft.AspNetCore.WebUtilities.dll

.

One or more packages are incompatible with UAP,Version=v10.0 (win10-x86).

.

Microsoft.Win32.Registry 4.3.0 provides a compile-time reference assembly for Microsoft.Win32.Registry on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x86.

What can I do ?

Update

After downgrading these two packages, my problem was solved and app deployed successfully:

"Microsoft.AspNetCore.DataProtection": 1.0.2

"Microsoft.EntityFrameworkCore": 1.0.2

1

1 Answers

1
votes

There are 2 things that could be going on here. First, I would change the imports line to

"imports": "portable-net45+win8+wpa81"

This makes it Profile259 compatible. Second, is I normally have trouble adding packages to my UWP project due to win10-x86 or any of its variants.

Go to the project.json file in your UWP project and delete all the runtime entries, so you will be left with this.

{
  "dependencies": {
    "Microsoft.NETCore.UniversalWindowsPlatform": "5.3.2",
    "Xamarin.Forms": "2.3.4.231",
    "Xamarin.Forms.CarouselView": "2.3.0-pre2"
  },
  "frameworks": {
    "uap10.0": {}
  },
  "runtimes": {
  }
} 

Now add your package. It should work. Now add back the runtime entries and your project should still run just fine.