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

Add DisableImplicitTransitiveReferences #1751

Merged
merged 2 commits into from
Nov 20, 2017

Conversation

jaredpar
Copy link
Member

This implements the feature described in #1750. It provides projects with a way to
explicitly opt-out of implicit transitive refernces by setting the
DisableImplicitTransitiveReferences property to 'true'.

closes #1750

This implements the feature described in dotnet#1750. It provides projects with a way to
explicitly opt-out of implicit transitive refernces by setting the
DisableImplicitTransitiveReferences property to `'true'`.

closes dotnet#1750
@@ -462,6 +462,7 @@ Copyright (c) .NET Foundation. All rights reserved.
-->

<Target Name="_ComputeTransitiveProjectReferences"
Condition="'$(DisableImplicitTransitiveReferences)' != 'true'"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this is needed from a correctness perspective. But it seemed to avoid unnecessary computation.

@jaredpar
Copy link
Member Author

Note: this feature idea was not formally approved. It is just a suggestion I made. Wanted to see how difficult it would be to implement myself. Turned out to be rather straight forward. Sending the PR optimistically 😄

@jaredpar
Copy link
Member Author

cc @nguerrera

@nguerrera
Copy link
Contributor

Change looks good to me.

On the property name, I think we should include "Project" in there. I think we can cut Implicit to keep it short enough. DisableTransitiveProjectReferences

The reason why I think "Project" is important: this will have no impact on the transitivity of nuget references

@jaredpar
Copy link
Member Author

@nguerrera name sounds good. Just pushed an update.

@nguerrera nguerrera merged commit 9fd61ad into dotnet:master Nov 20, 2017
@decv86
Copy link

decv86 commented Nov 10, 2018

hi. help pls. how it use? where need it write?

@nguerrera
Copy link
Contributor

@decv86 Edit your .csproj file and add:

<PropertyGroup>
 <DisableTransitiveProjectReferences>true</DisableTransitiveProjectReferences>
</PropertyGroup>

@decv86
Copy link

decv86 commented Nov 10, 2018

2018-11-10_17-49-01
Tnx!
But it doesn’t work for me, I don’t understand why, but my small project now unloads 111 dlls :(((
Tell me if you have any ideas I use .Туе 4.6.1 and PackageReference...

@nguerrera
Copy link
Contributor

nguerrera commented Nov 10, 2018

What you are seeing has nothing to do with this issue. That is not a project that uses Microsoft.NET.Sdk, therefore it wouldn't have transitive project references to begin with.

Also, you've used the property name as it was spelled in the PR description above, but not how it was finally spelled when the PR was done. The correct spelling is DisableTransitiveProjectReferences, not DisableImplicitTransitiveReferences. But just delete it, because it doesn't do anything in non-sdk projects.

You will get the transitive references of your package references as well as support dlls to handle .net earlier than 4.7.2 referencing .net standard greater than 1.5, which applies here I believe.

I can't say offhand if that's 111 (was that the actual count?) because I don't know all the dependencies of your package references are.

If you can target .net 4.7.2, you will get fewer dlls because it has more of what you reference in the box.

If you want to discuss this further, please file a new issue, and include the text of a repro project, not a screenshot.

JL03-Yue pushed a commit that referenced this pull request Mar 19, 2024
[main] Update dependencies from dotnet/roslyn
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.

Feature request: DisableImplicitTransitiveReferences
3 participants