NuGet / Samples

NuGet team sample repo
Other
136 stars 108 forks source link

Does nuget support enabling CPM for a subset of folders? #70

Closed QianYC closed 1 year ago

QianYC commented 1 year ago

Hi, I wonder if CPM can only be applied to a subset of folders? Say we have the below directory structure, the CPM applies to all projects in solution1 for sure, is solution2 also affected? If so, is there a way to disable CPM for solution2?

Repository

zivkan commented 1 year ago

It's all MSBuild, which is a scripting language, so you can do basically whatever you want, and like most programming languages, there are many ways you could do it.

One way to do it is to do "multi-level merging" as MSBuild documents here: https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-by-directory?view=vs-2022#use-case-multi-level-merging

Another way is to use MSBuild conditions: https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-conditions?view=vs-2022 and https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-reserved-and-well-known-properties?view=vs-2022

QianYC commented 1 year ago

thanks @zivkan!