簡體   English   中英

Windows 10 IoT ARM(Raspberry Pi)System.Threading-缺少參考

[英]Windows 10 IoT ARM (Raspberry Pi) System.Threading - missing references

我正在嘗試為Raspberry Pi 2編譯UWP C#解決方案。這是project.json

{
 "dependencies": {
  "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0",
},
"frameworks": {
    "uap10.0": {
    "imports": [
     ]
    }
},
"runtimes": {
    "win10-arm": {},
    "win10-arm-aot": {},
    "win10-x86": {},
    "win10-x86-aot": {},
    "win10-x64": {},
    "win10-x64-aot": {}
    }
}

問題是我引用(通過dll,我無法通過對項目的常規引用將其添加)到另一個項目,該項目對某些線程操作使用System.Threading。 這是project.json

{
"version": "1.0.0-*",

"dependencies": {
  "ELMSDefinitionsCore": "1.0.0-*",
  "NETStandard.Library": "1.6.1",
  "System.ComponentModel.Primitives": "4.2.0",
  "System.Xml.XmlSerializer": "4.2.0",
  "UniversalSerialPort": "1.0.0-*",
  "System.Security.Cryptography.Algorithms": "4.0.0",
  "System.Threading.Thread": "4.3.0"
 },

"frameworks": {
  "netcoreapp1.1":
{
    "imports": "dnxcore50",
    "dependencies":
  {
      "Microsoft.NETCore.App":
    {
        "type": "platform",
        "version": "1.1.0"
      }
    }
 },
"netstandard1.4":
{
      "imports": "dnxcore50"
},

 "net462": {
   "dependencies": {
   }
 }
}
}

編譯時,我會收到多個這樣的警告:

C:\\ Program Files(x86)\\ MSBuild \\ Microsoft.NetNative \\ ARM \\ ilc \\ IlcInternals.targets(936,5):警告:ILTransform_0003:方法“ GroupSelect.StartGroupLoop(byte [])”將始終由於以下原因而引發異常缺少的方法“ ThreadStart..ctor(object,IntPtr)”。 可能缺少一個程序集。

所有警告均與所引用的庫有關。

我已經嘗試了該主題的解決方案,但沒有任何幫助: 在Windows 10 IoT上的Raspberry Pi上找不到System.Threading 4.0.10

我解決了問題。

首先-在UWP項目引用的每個項目中,最好進行UWP配置(示例):

"uap10.0": {
      "imports": "dnxcore50",
                "runtimes": {
        "win10-arm": {},
        "win10-arm-aot": {},
        "win10-x86": {},
        "win10-x86-aot": {},
        "win10-x64": {},
        "win10-x64-aot": {}
      },
      "dependencies": {"System.Threading.Thread": "4.0.10.0" }
}

第二件事-您不能在UWP應用中使用線程。 您必須將線程重寫為async等待並改為使用Task

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM