-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Adding one more condition so that we can override adding shims for net471 in case they are required #1731
Conversation
…t471 in case they are required
@dotnet-bot test OSX10.12 Debug please |
@@ -50,7 +50,7 @@ Copyright (c) .NET Foundation. All rights reserved. | |||
<!-- 1. The .NET Standard 2.0 support need to be injected --> | |||
<_RunGetDependsOnNETStandard Condition="'$(DependsOnNETStandard)' == '' AND '$(NETStandardInbox)' != 'true'">true</_RunGetDependsOnNETStandard> | |||
<!-- 2. The target framework is .NET 4.7.1, which needs to special case some shims --> | |||
<_RunGetDependsOnNETStandard Condition="'$(_TargetFrameworkVersionWithoutV)' == '4.7.1'">true</_RunGetDependsOnNETStandard> | |||
<_RunGetDependsOnNETStandard Condition="'$(DependsOnNETStandard)' == '' AND '$(_TargetFrameworkVersionWithoutV)' == '4.7.1'">true</_RunGetDependsOnNETStandard> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this condition should check against "not true" instead of empty. Though, I see that above we are doing the check in a similar manner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we are really checking here is whether or not we have to run the DependsOnNETStandard task, and so what we check is that if we don't know yet if we depend on it or not (if value is empty) then we might want to run the task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we added a condition to be "not true", then what if we want to force the property to be false? We would evaluate this condition to be true and run the task anyway which will override the value we wanted to force, which is why we should check against empty.
Could we add some tests for this property? |
I added a test and ran it locally (I do have 4.7.1 targeting pack installed) and it passed successfully. |
…928.13 (#1731) [main] Update dependencies from dotnet/roslyn
cc: @livarcocc @AlexGhiondea @weshaggard @dsplaisted
During my testing I found one more thing that we can improve with the current targets. The problem to solve, is that in the case your app is in a state where we don't automatically detect that you need the shims (for example if you don't directly reference a netstandard based library but one of your dependencies does) and you are targeting .NET 4.7.1, there is no quick property that you can set in order to force the shims to be deployed with the app. The only current workaround for that, would be to add a direct reference to a netstandard based component directly, so that our logic kicks in. I don't think that this is a good behavior, which is why I would like to try to squish this change in, so that if users need to deploy the shims for 4.7.1, they can simpy set property
<DependsOnNETStandard>true</DependsOnNETStandard>
in order to accomplish that.