Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
158 views
in Technique[技术] by (71.8m points)

c# - Unknown build error Cannot resolve dependency to System.Windows

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...