在Windows 10 IoT上的Raspberry Pi上找不到System.Threading 4.0.10 [英] Can't find System.Threading 4.0.10 on Raspberry Pi on Windows 10 Iot

查看:117
本文介绍了在Windows 10 IoT上的Raspberry Pi上找不到System.Threading 4.0.10的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从IoT模板创建一个新的简单UWP Blank应用程序,并向其中添加一个简单代码:

  var xyz =新的System.Threading.ManualResetEvent(false); 
xyz.WaitOne(1000);

当我在PC上以x86模式运行时,它可以正常工作,而在Raspberry Pi上则可以工作在将PC升级到.NET Core RC2之前运行Windows 10 IoT。现在,我收到一条错误消息,说我在RPi上执行时找不到System.Threading版本4.0.10。我尝试通过NuGet添加此文件,但没有区别。我可以在Pi上看到System.Threading.dll,虽然它的版本是4.6,但是我没有地方配置程序集重定向等。



如何制作此文件.NET Core RC2和RPi实现简单的应用程序? (请注意,上面的示例仅显示了导致崩溃的原因,这不是一个真正的程序,我不希望只是做一个延迟,它只是一个示例,它显示了在访问System.Threading上的任何内容时发生崩溃的情况。) / p>

以下是异常详细信息:
无法加载文件或程序集'System.Threading,版本= 4.0.10.0,区域性=中性,PublicKeyToken = b03f5f7f11d50a3a'或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。 (来自HRESULT的异常:0x80131040)
当我尝试实例化具有上述行的类时,会发生这种情况。



project.json:

  {
dependencies:{
Microsoft.NETCore.UniversalWindowsPlatform: 5.1.0,
System.Threading: 4.0.10
},
frameworks:{
uap10.0:{}
},
运行时间:{
win10-arm:{},
win10-arm-aot:{},
win10-x86 :{},
win10-x86-aot:{},
win10-x64:{},
win10-x64-aot:{}
}
}

我尝试使用和不使用System.Threading,相同的问题



我尝试在调试中仅使用F5运行/调试(在远程计算机上)。一切都会按原样发送到RPi,如果我删除对Threading的引用,则它运行良好。我已经尝试构建10586和最新版本10.0.14342.1000。

解决方案

我尝试重新安装Visual Studio等。还卸载了.NET Core RC2,也与此无关。最终解决的问题是删除%userprofile%.nuget文件夹,以便重新下载所有软件包。我认为某些东西一定已经损坏了。


I'm creating a new simple UWP Blank application from the IoT template, and just adding a simple code to it:

        var xyz = new System.Threading.ManualResetEvent(false);
        xyz.WaitOne(1000);

It works fine when I run this in x86 mode on my PC, and it worked fine on Raspberry Pi running Windows 10 IoT before I upgraded my PC to .NET Core RC2. Now I'm getting an error saying it can't find System.Threading version 4.0.10 when I execute it on the RPi. I've tried to add this via NuGet but no difference. I can see System.Threading.dll on the Pi, it's version 4.6 though, but I have no place to configure an assembly redirect, etc.

How can I make this simple app work with .NET Core RC2 and RPi? (Note that the example above just shows what causes it to crash, it's not a real program and I'm not looking to just do a delay, it's just a sample that shows the crash when you access anything on System.Threading.)

Here are the exception details: Could not load file or assembly 'System.Threading, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) This happens when I try to instantiate the class that has the lines above.

Here's the project.json:

{
  "dependencies": {
    "Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0",
    "System.Threading": "4.0.10"
  },
  "frameworks": {
    "uap10.0": {}
  },
  "runtimes": {
    "win10-arm": {},
    "win10-arm-aot": {},
    "win10-x86": {},
    "win10-x86-aot": {},
    "win10-x64": {},
    "win10-x64-aot": {}
  }
}

I have tried with and without the System.Threading in there, same issue.

I try to just run/debug this (on the remote machine) with F5, in debug. Everything is sent over to the RPi as it should, and if I remove the reference to Threading then it runs fine. I have tried both build 10586 and the latest 10.0.14342.1000.

解决方案

I've tried to reinstall Visual Studio, etc. I also uninstalled .NET Core RC2, it wasn't related to that either. What finally fixed it was deleting the %userprofile%.nuget folder so all packages gets re-downloaded. I assume something must've become corrupt or something.

这篇关于在Windows 10 IoT上的Raspberry Pi上找不到System.Threading 4.0.10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆