Comments (2)
What's happening here is that the Choose condition evaluation happens only in the properties evaluation pass (pass 1), at which time the condition isn't true--Directory.Build.props
is imported before the body of the project, so IsTestProject
hasn't been set yet when the condition evaluates.
ItemGroup evaluation happens later (in pass 3), after all properties (from all imports) have been set, so your step-6 condition evaluates to the value you expect.
I was a bit surprised by this Choose condition timing, and it doesn't seem to be well documented outside this comment which doesn't help anyone:
msbuild/src/Build/Evaluation/Evaluator.cs
Lines 1492 to 1497 in e8d6beb
from msbuild.
Hi @rainersigwald,
If I understand correctly, the observed behaviour is by design. Which would be quite logical if project related files are interpreted in multiple passes and the Choose
block is only evaluated once. The current behaviour is therefore quite obscure, and I would rather avoid its usage altogether.
Would it be an option to modify the behaviour of the Choose
block so it is evaluated in each pass?
from msbuild.
Related Issues (20)
- [Bug]: Cannot use Microsoft.Build.Utilities.Core 17.10.4 NuGet package HOT 4
- Correct way to generate sources for an external project (with incompatible `TargetFramework`)?
- [Feature Request]: Localize MSBuild messages with MSBuildInternalMessage task
- [Bug]: BuildCheck: Internal error thrown when reporting results HOT 1
- [Broken Build]: Blazor Integrity issue HOT 1
- [Bug]: NRE in at Microsoft.Build.BackEnd.TargetEntry.<ExecuteTarget>d__44.MoveNext() HOT 4
- Request to backport getResultOutputFile from 8.0.3xx to 8.0.1xx SDK. HOT 3
- [Bug]: CI/CD pipeline broken after update from 17.9 to 17.10: no Appx packages generated HOT 2
- [Bug]: OOM Exception due to infinite loop in FileMatcher HOT 2
- [Feature Request]: The way publish dll only HOT 7
- [Refactoring] Move all Xml*WithLocation to Microsoft.Build.Framework
- [Feature Request]: Reduce the wrapping around SDK Resolver messages when only one resolver is actually invoked HOT 1
- Analyzer for Property read before assigned HOT 2
- [Bug]: Incorrect framework library is used sometimes during build HOT 1
- Q: Verifying NuGet single multi targeting build assets importation HOT 25
- [Bug]: Project file does not exist with LongPaths HOT 4
- [Bug]: Breaking change in serialized BuildResult can lead to errors in result caching with older data HOT 1
- Add documentation for the risks for version incompatibilities between msbuild and a plugin dependencies HOT 8
- MSBuild Threat Modeling
- MSBuild High Level Overview document
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msbuild.