-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mark "target framework" as a variant dimension #3020
Conversation
We need to consume a new API from CPS, and hence need to upgrade dependency. It brings in a new MSBuild dependency so we need to upgrade it too to avoid conflicts.
This marks "target framework" dimension as a variant dimension; ie a configuration dimension that when present is is effectively ignored when calculating "active configurations" returned by IActiveConfigurationGroupService: For example, given the following multi-targeting project: -> All known project configurations: Configuration Platform TargetFramework ------------------------------------------- Debug | AnyCPU | net45 Debug | AnyCPU | net46 Release | AnyCPU | net45 Release | AnyCPU | net46 -> Active solution configuration: Debug | AnyCPU | net45 -> Target framework dimension is ignored, and active configurations returned by IActiveConfigurationGroupService: Debug | AnyCPU | net45 Debug | AnyCPU | net46 Whereas, given the following non-multi-targeting project: -> All known project configurations: Configuration Platform ------------------------ Debug | AnyCPU Release | AnyCPU -> Active solution configuration: Debug | AnyCPU -> Active configurations return active configurations returned by IActiveConfigurationGroupService: Debug | AnyCPU
Still testing these bits, CPS is already consuming this - so adding this attribute will immediately take effect for the Error List. Now all errors/warnings from all design-time builds for a multi-targeting project will be added to it, instead of just the first "active" one. |
LGTM - is the plan to merge this now and then follow up, or add more commits to this PR? |
Don't plan on adding more commits to this PR - but am still testing this. |
Okay was wrestling with this all day - finally got bits that work. Before this change, given this project: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.0;net45</TargetFrameworks>
</PropertyGroup>
<Target AfterTargets="Compile" Name="FooBar">
<Warning Text="$(TargetFramework)" />
</Target>
</Project> The following would be output into the Error List after a design-time build:
After this change, the folllowing is now output to the Error List:
|
This is ready for signoff. |
@lifengl When are you planning on inserting this so that we can coordinate? |
can we add a test for this please? |
We don't have working VSI tests - how would you propose I write one? |
One of many changes as we move to using the new IActiveConfigurationGroupService which returns all the configurations that we consider "active" for a multi-targeting scenarios (replacing IActiveConfiguredProjectsProvider).
This marks "target framework" dimension as a variant dimension; ie a configuration dimension that when present is effectively ignored when calculating "active configurations" returned by IActiveConfigurationGroupService:
For example, given the following multi-targeting project:
Whereas, given the following non-multi-targeting project: