未知的生成错误无法解析依赖于System.Windows [英] Unknown build error Cannot resolve dependency to System.Windows

查看:472
本文介绍了未知的生成错误无法解析依赖于System.Windows的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚下载 PoshConsole 的源代码,并试图建立自己的解决方案。我最初有两个问题 -




  1. 在System.Interactivity.dll无法解析。我安装了混合4 SDK,并且错误已修复


  2. 未知的生成错误 - 无法解析依赖于System.Windows




现在,每当我试图构建项目,我得到的解决方案中的两个项目下面的错误,我一直没能找到解决办法经过一番google搜索左右。




无法解析的依赖到组装'System.Windows,
版本= 2.0.5.0,文化=中性公钥= 7cec85d7bea7798e'
,因为它没有被预装。当使用ReflectionOnly的API,
依赖组件必须预先加载或装载在通过
上ReflectionOnlyAssemblyResolve事件需求



解决方案

我收到另一个(非GAC,自定义)组装此错误消息。



在我的情况下,情况如下:




  • 组装十载类A

  • 装配Y包含b类,这从A继承

  • 组装Z含数据模板为b级



Ÿ引用X,Z参考年。



该错误信息是指向在b的参考Z轴数据模板的线,并指出是X不能被加载。



解决的办法是有Z还没范围X。显然,编译器无法解析装上了自己所需要的程序集传递引用。


I just downloaded PoshConsole's source code and was trying to build the solution. I initially had two problem -

  1. the System.Interactivity.dll could not be resolved. I installed Blend 4 SDK and that issue was fixed.

  2. Unknown build error - Cannot resolve dependency to System.Windows

Right now, whenever I try to build the project, I get the following error in two projects in the solution and I haven't been able to find a solution after some googling around.

Cannot resolve dependency to assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' 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 received this error message for another (non-GAC, custom) assembly.

In my case, the situation was as follows:

  • assembly X contains class A
  • assembly Y contains class B, which inherits from A
  • assembly Z contains a data template for class B

Y referenced X, Z referenced Y.

The error message was pointing to the line in the data template in Z where B was referenced, and pointed out that X could not be loaded.

The solution was to have Z also reference X. Apparently, the compiler cannot resolve that transitive reference for loading the required assemblies on its own.

这篇关于未知的生成错误无法解析依赖于System.Windows的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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