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
154 views
in Technique[技术] by (71.8m points)

c# - Why must I chain reference assemblies?

My project references an assembly (will call it X) that references another assembly (will call it Y).

When I try to compile my project, it demands that it should reference assembly Y. Why is that? I get the following error on the line where assembly X is referenced:

The type 'DevExpress.XtraEditors.XtraForm' is defined in an assembly that is not referenced. You must add a reference to assembly 'DevExpress.Utils.v9.1, Version=9.1.2.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a'.

DevExpress.XtraEditors.XtraForm is the assembly Y.

Why is this? I have not seen this behavior before.

See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

This has always been in place. You will only get these at compile time if you're using an object that gets methods/properties/members etc from assembly Y.

The why is because .NET cannot rely on assembly X to ensure it will be able to obtain proper symbol and meta data information.


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

...