我遇到此错误:
Severity Code Description Project File Line Suppression State
Error CS7069 Reference to type 'Task<>' claims it is defined in 'System.Runtime', but it could not be found DJIWSDKDemo C:\Users\almendro.avellano\source\repos\DJIWSDKDemo\DJIWSDKDemo\MainPage.xaml.cs 61 Active
如果我注释该行并运行它,请告诉我下一个错误:
System.Reflection.TargetInvocationException
HResult=0x80131604
Message=Exception has been thrown by the target of an invocation.
Source=
StackTrace:
Inner Exception 1:
FileLoadException: Could not load file or assembly 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. Exception from HRESULT: 0x80131040
我正在使用VS2019。谢谢您的帮助
答案 0 :(得分:0)
在VS2017上遇到同样的麻烦:
var productType = (await DJISDKManager.Instance.ComponentManager.GetProductHandler(0).GetProductTypeAsync()).value;
除错误外,还有11条与System.Threading, System.Runtime
等版本之间的冲突有关的警告。
VS或Universal Windows参考可能有问题。