“无法解析对程序集的依赖性”的原因错误
什么时候会显示以下消息?
错误 1 未知构建错误,“无法解析对程序集“Infragistics2.Win.v10.3,版本=10.3.20103.2015,Culture=neutral,PublicKeyToken=7dd5c3163f2cd0cb”的依赖关系,因为它尚未预加载。使用 ReflectionOnly API 时,必须通过 ReflectionOnlyAssemblyResolve 事件预加载或按需加载依赖程序集。'
我已向现有工作项目添加了一些 DLL。我知道如果没有代码库的详细信息,很难查明原因,但我想知道出现此类错误消息的一般原因是什么?
注意: 刚刚创建了一个新的 WPF 项目并添加了一堆新的 DLL。这个问题也存在于此。因此,该问题很可能是由 DLL 的组织和内容引起的。
When would the following message be shown?
Error 1 Unknown build error, 'Cannot resolve dependency to assembly 'Infragistics2.Win.v10.3, Version=10.3.20103.2015, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.'
I have added few DLLs to an existing working project. I know it's difficult to pin point the reason without the details on the code-base, but what I would like to know the general cause for such error messages to appear?
Note: Just created a fresh WPF project and added the bunch of new DLLs. The issue is present there also. Therefore, it's highly likely that the issue is due to organization and content of the DLLs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您的 xaml 文件静态引用视图模型类,并且该视图模型类具有 xaml 文件中可能无法识别为缺失的依赖项,则可能会发生这种情况。您需要将该依赖项添加到有问题的项目中。因为它是在 xaml 文件中引用的,所以编译时错误并不清楚问题的根源。
This can happen if your xaml file statically references a view model class and that view model class has a dependency which may not be recognised as missing in the xaml file. You will need to add that dependency to the offending project. Because it is referenced in the xaml file compile time errors aren't clear on the source of the problem.
缺少正确版本的 Infragistics DLL,添加它可以解决该问题。
注意:问题过于局部化,因此该解决方案仅在本地系统中有用。
Proper version of Infragistics DLL was missing and adding it resolved the issue.
Note: The problem is too localized and hence this solution is useful at local system only.