Setting up a build dependency without using a reference?

青春壹個敷衍的年華 提交于 2019-11-27 09:34:44

Right click the root node in Solution Explorer -> Properties -> Project Dependencies. (VS 2008 users: this feature gets its own dialog box that's directly accessible from the context menu.)

The dependency graph is represented as an adjacency list of checkboxes. Each project you select will have its direct references checked & disabled [assuming you use project refs, not assembly refs]. Other checkboxes might be disabled if they would create a circular dependency.

For any checkbox not disabled, checking/unchecking will write a ProjectSection(ProjectDepedencies) section into your solution file. So your settings will propagate to other developers via source control.

Fair warning though: if you use MSBuild (including any version of Team Build), it does not always handle *.sln file customizations the same way that builds inside Visual Studio do. *.sln is not a native MSBuild file type, unlike *.??proj files. I myself have run into the problem described here; I've also seen the opposite behavior on occasion.

Can I suggest creating a dummy (empty) project, to represent the combination of the main exe and the plugin, and configuring that project to be dependent on both, but run the EXE on launch?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!