Skip to content
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

Merged
merged 2 commits into from
Nov 15, 2017

Conversation

joperezr
Copy link
Member

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.

@joperezr
Copy link
Member Author

@dotnet-bot test OSX10.12 Debug please
@dotnet-bot test OSX10.12 Release please (both build succeeded but there was a problem after build was done.)

@@ -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>
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Member Author

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.

@livarcocc
Copy link
Contributor

Could we add some tests for this property?

@joperezr
Copy link
Member Author

I added a test and ran it locally (I do have 4.7.1 targeting pack installed) and it passed successfully.

@livarcocc livarcocc merged commit 8e1678d into dotnet:master Nov 15, 2017
JL03-Yue pushed a commit that referenced this pull request Mar 19, 2024
…928.13 (#1731)

[main] Update dependencies from dotnet/roslyn
@joperezr joperezr deleted the ManualOverrideShims branch June 12, 2024 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants