How to emulate /p msbuild parameter in Visual Studio build?

前端 未结 2 672
被撕碎了的回忆
被撕碎了的回忆 2021-01-13 21:43

That the logical follow-up for the my previous question: \"How to check all projects in solution for some criteria?\"
I was given quite a good answer to use CustomAfterM

2条回答
  •  伪装坚强ぢ
    2021-01-13 22:34

    I use a bit different technique then @Spider M9. I want that all projects in solution tree/all subdirectories from current directory use extended build throw Custom*MicrosoftCommonTargets. I don't like to be forced to change every new project to import custom targets/props.

    I place special file, let's say msbuild.include, in the root directory and my custom targets loader for every project tries to find it in ., ..\, ..\..\, and so on. msbuild.include contains flags that triggers execution of custom actions. If loader can't find this file it disables loading all custom targets and stoppes. This gives me ability to use my build extensions with projects from work repositories and to not use with opensource projects.

    If you are interested in I can publish loader. It's a pretty simple and elegant solution.

    For example I can sign any assembly in all projects in all subfolders with my key.

提交回复
热议问题