如何使用 ProjectReference 引用项目的多个输出
假设项目 A 生成一个主要程序集,但也通过使用(我们自己制作的)MSBuild 任务生成一些程序集。
有没有一种方法可以让项目 B(具有对项目 A 的 ProjectReference)也可以引用任务生成的程序集,而无需进行太多修改(我知道,这是相当相对的概念;-))?
Assume Project A produces a primary assembly but also some assemblies through the use of an MSBuild task (of our own making).
Is there a way for Project B, that has a ProjectReference to Project A, to also reference the assemblies that are produced by the task without hacking too much (I know, quite relative concept ;-))?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
按照惯例,项目有一个负责生成的主要目标,尽管该目标可以是多个相关文件。例如,
MyLib.csproj
可能会生成一个MyLib.dll
,并支持MyLib.pdb
和MyLib.dll.config
文件。通常,与项目目标名称匹配的某些已知文件扩展名的文件会关联在一起。ProjectReference
将引入所引用项目的主要目标程序集、与目标程序集直接关联的文件(例如 .pdb 和 .config)以及一个深度的程序集(及其关联文件)。由主要目标组件链接。如果您创建了一个具有“多个输出”的项目,那么您还必须创建引用“多个输出”的支持。
By convention a project has one primary target that it is responsible for producing, although that can be multiple related files. e.g. A
MyLib.csproj
may produce aMyLib.dll
with supportingMyLib.pdb
andMyLib.dll.config
files. In general, files of certain known file extensions that match the name of the project target are associated together.A
ProjectReference
will bring in the primary target assembly of the referenced project, files directly associated with the target assembly (e.g. the .pdb and .config), and one depth of assemblies (and their associated files) that are linked to by the primary target assembly.If you have created a project with 'multiple outputs' then you will also have to create the support to reference the 'multiple outputs'.