【发布时间】:2020-05-19 07:59:12
【问题描述】:
我正在为我的应用程序(C#、WPF)开发插件系统。我的项目结构是这样的:
Solution 'App'
Plugins (solution folder)
Plugin1 project (dll)
Plugin2 project (dll)
MainApp project (WPF)
PluginInterface project (dll)
我编辑了项目的属性,以这种方式在自定义文件夹中构建它们
Build
Debug
MainApp.exe
PluginInterface.dll
Plugins (folder)
Plugin1.dll
Plugin2.dll
由于插件应该实现Iplugin 接口(在PluginInterface 项目中),我将PluginInterface 项目添加到每个插件项目的引用中。但是,这会导致 Visual Studio 在 Plugins 文件夹中构建 PluginInterface.dll 的副本,而 PluginInterface 项目的输出路径只是设置为 Build\Debug。
我还尝试在 Build\Debug(不是项目)中引用 PluginInterface.dll 文件,但结果相同(我没有忘记在构建之前删除所有创建的文件)。
我应该如何防止 Visual Studio 复制 PluginInterface.dll 文件?
【问题讨论】:
-
你不能 - 它是一个依赖项,所以你需要使用 dll 构建项目,因此它将被放在输出目录中,我也花了一些时间。
标签: c# visual-studio project-reference