Can't build xamarin PCL Project

TiesTies NLMember ✭✭

Hy,

I'm developing an xamarin PCL project for the platforms Android and UWP. On Android it works perfect but on UWP I get the following error:

"System.IO.FileNotFoundException occurred
HResult=0x80070002
Message=Could not load file or assembly 'clrcompression, Culture=neutral, PublicKeyToken=null'. Het systeem kan het opgegeven bestand niet vinden.
Source=
StackTrace:
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)"
This happens when xamarin.forms.init(e) is called.

How to fix this?

Answers

  • kentuckerkentucker USMember ✭✭✭✭

    did you add a nuget package to the pcl that you did not add to the uwp app?

  • TiesTies NLMember ✭✭

    Multible, I now have insured that all the nuget packages are in both the pcl application and in the uwp application. Same for the portable libs.

  • TiesTies NLMember ✭✭

    Because I added all the nuget packages i now get the following errors:

    System.IO.FileNotFoundException occurred
    HResult=0x80070002
    Message=Could not load file or assembly 'clrcompression, Culture=neutral, PublicKeyToken=null'. Het systeem kan het opgegeven bestand niet vinden.
    Source=
    StackTrace:
    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
    at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

    System.IO.FileNotFoundException occurred
    HResult=0x80070002
    Message=Could not load file or assembly 'clrjit, Culture=neutral, PublicKeyToken=null'. Het systeem kan het opgegeven bestand niet vinden.
    Source=
    StackTrace:
    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
    at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

    System.IO.FileNotFoundException occurred
    HResult=0x80070002
    Message=Could not load file or assembly 'sqlite3, Culture=neutral, PublicKeyToken=null'. Het systeem kan het opgegeven bestand niet vinden.
    Source=
    StackTrace:
    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
    at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

    System.IO.FileNotFoundException occurred
    HResult=0x80070002
    Message=Could not load file or assembly 'ucrtbased, Culture=neutral, PublicKeyToken=null'. Het systeem kan het opgegeven bestand niet vinden.
    Source=
    StackTrace:
    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
    at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

  • TiesTies NLMember ✭✭
    edited October 30

    for the detailed information.

    I have a main application (pcl) with the platforms Android and UWP.
    These have the following nuget packages in uwp

    "Microsoft.NETCore.Platforms": "1.1.0",
    "Microsoft.NETCore.UniversalWindowsPlatform": "6.0.1",
    "Microsoft.Toolkit.Uwp.Notifications": "2.0.0",
    "Newtonsoft.Json": "10.0.3",
    "Rg.Plugins.Popup": "1.0.4",
    "SQLite.Net-PCL": "3.1.1",
    "SQLite.Net.Core-PCL": "3.1.1",
    "System.IO": "4.3.0",
    "System.Net.Sockets": "4.3.0",
    "System.ObjectModel": "4.3.0",
    "System.Runtime": "4.3.0",
    "System.Runtime.Handles": "4.3.0",
    "System.Threading": "4.3.0",
    "Xam.Plugin.Connectivity": "3.0.3",
    "Xam.Plugins.DownloadManager": "1.3.2",
    "Xamarin.Forms": "2.4.0.18342",
    "ZXing.Net.Mobile": "2.2.9",
    "ZXing.Net.Mobile.Forms": "2.2.9"
    

    in PCL:

    package id="Newtonsoft.Json" version="10.0.3" targetFramework="portable45-net45+win8" /
    package id="Rg.Plugins.Popup" version="1.0.4" targetFramework="portable45-net45+win8" /
    package id="SQLite.Net.Core-PCL" version="3.1.1" targetFramework="portable45-net45+win8" /
    package id="SQLite.Net-PCL" version="3.1.1" targetFramework="portable45-net45+win8" /
    package id="System.Runtime" version="4.3.0" targetFramework="portable45-net45+win8" /
    package id="System.Threading" version="4.3.0" targetFramework="portable45-net45+win8" /
    package id="Xam.Plugins.DownloadManager" version="1.3.2" targetFramework="portable45-net45+win8" /
    package id="Xamarin.Forms" version="2.4.0.18342" targetFramework="portable45-net45+win8" /
    package id="ZXing.Net.Mobile" version="2.2.9" targetFramework="portable45-net45+win8" /
    package id="ZXing.Net.Mobile.Forms" version="2.2.9" targetFramework="portable45-net45+win8" /

    In the main app I'm using multible portable library project.
    portablelib1 contains:
    pcl:

    package id="Newtonsoft.Json" version="10.0.3" targetFramework="portable45-net45+win8" /
    package id="SQLite.Net.Core-PCL" version="3.1.1" targetFramework="portable45-net45+win8" /
    package id="SQLite.Net-PCL" version="3.1.1" targetFramework="portable45-net45+win8" /
    package id="Xamarin.Forms" version="2.4.0.18342" targetFramework="portable45-net45+win8" /

    uwp:
    Microsoft.netcore.universalwindowsplatform
    newtonsoft.json
    sqlite.net-pcl
    sqlite.net.core-pcl
    xamarin.froms

    portablelib2 contains:
    pcl:

    package id="Xamarin.Forms" version="2.4.0.18342" targetFramework="portable45-net45+win8" /

    uwp:
    microsoft.netcore.universalwindowsplatform
    microsoft.toolkit.uwp.notifications.
    sqlite for universal windows platform
    universal windows
    windows desktop extensions for the uwp
    windows IoT extensions for the UWP
    Windows Mobile extensions for the uwp
    Windows Team extensions for the uwp
    xam.plugin.connectivity
    xamarin.forms

Sign In or Register to comment.