How to include project on build but exclude on publish?

Viewed 34

I have a solution that includes a number of projects that are plugins, ie. these projects are not referenced in the main project.

In order to copy the files on build I have a post-build event that simply copies the files as in:

xcopy "$(SolutionDir)bin\Debug\net5.0\MyApp.Plugin.*.dll" "$(TargetDir)" /Y

The above is for each and every plugin project.

These type of projects are increasing and it is getting quite messy on build and publish. So I was thinking of creating a dummy project that references all these projects and then reference this dummy project in the main app project.

With the above approach I can have all files in my bin folder so I can test locally. But obviously I don't need the dummy project on publish.

Is there a better solution on how to reference projects and exclude projects on publish?

0 Answers
Related