C# 在 VS 中构建 - 单独的 API 引用?
这是 VS 2008 中的场景:我有 App1 和 App2,它们都包含对自定义 Library1 的引用。 Library1 引用了仅由 App1 使用的 API1 和仅由 App2 使用的 API2。但是,当我构建 App1 时,它包含 API1 和 API2 两者所需的所有库/文件(反之亦然)。有没有办法确保 App1 的构建仅包含 Library1 对该构建所需的引用?
Here's the scenario in VS 2008: I have App1 and App2 and both of them contain references to custom Library1. Library1 has references to API1 which is only used by App1 and API2 which is only used by App2. However, when I build App1 it contains all of the libraries/files required by both API1 and API2 (and vice-versa). Is there a way to ensure that a build of App1 will only contain the references needed by Library1 for that build?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,因为该库是在不知道谁将使用其中的哪些引用的情况下构建的。因此,在构建库时,所有引用都会链接起来,无论有多少个应用程序(可能为零)引用该库。
如果分离实现非常重要,您可以从 Library1 访问 API1,并创建一个新库 Library2 来访问 API2。
No, since the library is built without any knowledge about who is going to use which references inside it. So all references are linked when building the library, no matter how many applications (this could be zero) you've got referencing the library.
You can access API1 from Library1 and create a new library Library2 to access API2 if it's that important that the implementation is separated.