简体   繁体   中英

Is there a way to ensure a specific visual studio project in a visual studio solution is only built on a build server (or a specific server)

Basically I want to block developers from building one of the projects in a solution that only the build server can/should build.

Alternatively, Developers would have a solution with projects A, B, C but not D. However, The build server would add project D to the solution. Then build the solution with projects A,B,C, & D.

Can this be done through code and/or configuration?

Thanks

Not really - if code is available it can be built by developers. One can create project file from source and build it to be able to debug the code for example.

You can use NuGet to import pre-built assemblies - this way you discourage building such code locally.

Note: make sure you understand reasons why one would want to build that code locally - debugging is very common reason and degrading debugging experience will slow your team down.

Well one of possible solution would be creating different build configurations . Each build configuration would include projects needed to run properly.

Simplified example:

Developers could use default Debug configuration to build projects A, B and C (D must be excluded from this configuration) to run application locally.

Production configuration would have all projects (A, B, C and D) included, and your continuous integration system would use that configuration to build your solution.

Keep in mind what others said, you won't be able to protect project D from manual or accidental builds, as long as it stays inside same solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM