-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
MSBuild has APIs to just evaluate a project's properties and items without building it (being aware of the disclaimers of #1285) but these do not take into accound any properties that are defined in any of the project's Imports.
I have thought of the following workaround: I will tell the BuildManager to build a nonexistent target, while passing BuildRequestDataFlags.SkipNonexistentTargets in the BuildRequestData.
My questions are:
-
Is there anything problematic with the approach I described? MSBuild will fully evaluate the project file and "run" a target that does not exist, ignoring it as I told. The default target will be prevented from running.
-
How about concurrency? It seems to me that the
BuildManagerclass is not thread-safe. So instead of locking around its use, I have thought of creating and reusingBuildManagerper thread. Is that good? Documentation says that "Normally there is only one build manager in a process, and it is the default build manager." but doesn't say what would happen if more than one build managers exist.