Skip to content

Ignoring import conditions #7171

Answered by rainersigwald
wuhkuh asked this question in Q&A
Discussion options

You must be logged in to vote

I don't think this could work because imports can be mutually incompatible. For instance some project type might have

<Import Condition="'$(ProjectSetting)' == 'true'" Project="WithSetting.targets" />
<Import Condition="'$(ProjectSetting)' != 'true'" Project="WithDefaultSettings.targets" />

And importing both could leave you in a highly undefined state.

Also,

The current strategy is to preprocess a project using the -preprocess flag, and then match PackageReference and PackageVersion items in the output.

I would recommend using the MSBuild API (with MSBuildLocator) instead; that will help with things like item Update operations that you might be missing with preprocessing.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wuhkuh
Comment options

Answer selected by wuhkuh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants