[英]Reference another project with Copy Local on it's reference
I have a project "ProjA" which wraps up references to several other projects and some 'plugin' assemblies. 我有一个项目“ ProjA”,其中包含对其他几个项目和一些“插件”程序集的引用。 All of those references have Copy Local set to 'True'.
所有这些引用的“本地复制”均设置为“ True”。 Note that the code in the plugin assemblies (which are project references) is not referred to in "ProjA" directly, but is loaded and located through DI/Ninject.
请注意,插件程序集中的代码(它们是项目引用)没有直接在“ ProjA”中引用,而是通过DI / Ninject加载和定位。 (So I'm using these project references as a way of getting the plugin assemblies into the output folder, see below for why)
(因此,我将这些项目引用用作将插件程序集放入输出文件夹的一种方法,请参阅下面的原因)
I also have project "ProjB", which references ProjA. 我也有引用ProjA的项目“ ProjB”。 It invokes ProjA code which should do it's thing, using the referenced plugin assemblies.
它使用引用的插件程序集调用应做的ProjA代码。
The problem is, it doesn't work. 问题是,它不起作用。 The plugin assemblies are not copied down from the ProjA output folder (which they are 'copied local'-into) into the ProjB output folder.
插件程序集不会从ProjA输出文件夹(已“本地复制”)复制到ProjB输出文件夹中。 So Ninject doesn't load them, and the thing fails.
因此Ninject不会加载它们,并且事情失败了。
So my two questions: 所以我有两个问题:
I have also considered and played with post-build steps for either the plugin projects (not ideal: I am pulling them into this new solution from another, if I add post-build steps it will likely screw up the other solution) or the project which depends on them (which is OK, but an XCopy with relative paths, and having to manually set up Project Dependencies.. seems more hacky again). 我还考虑了插件项目的构建后步骤(并不理想:我将它们从另一个项目中拉到这个新解决方案中,如果我添加了构建后步骤,则很可能会破坏其他解决方案)或项目这取决于它们(可以,但是带有相对路径的XCopy,并且不得不手动设置项目依赖项。似乎又变得更加棘手了)。
Is there something I'm missing, any ideas at all? 有什么我想念的东西吗? If Copy Local chained across project references it would fit perfectly..
如果跨项目引用链接“复制本地”,则将非常适合。
似乎无法使用Visual Studio或msbuild。
Copy local = true is the source of all VS evils. 复制local = true是所有VS弊端的根源。 Well, most at least.
好吧,至少是这样。
I'd go with just saying - don't use it. 我只想说-不要使用它。 Have one nice outputdir, like T:\\Bin, and copy everything you need using post build scripts to that dir.
有一个不错的outputdir,例如T:\\ Bin,然后使用构建后脚本将所需的所有内容复制到该目录。 And run from there.
然后从那里跑。 Don't just put your trust in VS and walk around like a blind mice.
不要只是相信VS,像瞎老鼠一样走来走去。
You may also consider using the GAC. 您也可以考虑使用GAC。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.