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

Package.config project fails to restore if parent directory has directory.build.props with packageref #5320

Closed
clairernovotny opened this issue Jun 1, 2017 · 4 comments
Assignees
Labels
Functionality:Restore Priority:2 Issues for the current backlog. Resolution:Duplicate This issue appears to be a Duplicate of another issue Type:Bug
Milestone

Comments

@clairernovotny
Copy link

clairernovotny commented Jun 1, 2017

In VS 2017, I have a solution with SDK style projects and an MVC 4.6 project with packages.config. If I add a directory.build.props file to the parent directory that contains a packageref, restore is incorrect in the mvc/packages.config project.

I would not expect directory.build.props to apply to non-SDK project types.

This happens with 15.2 and 15.3 preview 1

@clairernovotny
Copy link
Author

Here's a repro https://github.com/onovotny/NuGetRestoreRepro

@dsplaisted
Copy link

Directory.Build.props is a feature of MSBuild 15, and is not specific to SDK-style projects.

Can you move the PackageReference to a Directory.Build.targets file and condition it on whether TargetFramework is set? (With the 2.0 SDK, you will be able to check the UsingMicrosoftNETSdk property instead, and you will be able to do that in the Directory.Build.props file if you like.) That should probably fix the issue.

@clairernovotny
Copy link
Author

Is there any default setting for PackageRestoreType that can be checked instead since some projects opt-in to PackageRef by default like UWP. Just seemed like unexpected behavior that would bite people?

@rrelyea rrelyea added this to the 4.4 milestone Jun 29, 2017
@rrelyea rrelyea modified the milestones: Backlog, 4.4 Sep 8, 2017
@rrelyea rrelyea added Priority:2 Issues for the current backlog. Triage:NeedsTriageDiscussion labels Sep 8, 2017
@nkolev92
Copy link
Member

At this point I believe this issue is a duplicate of #4488.

RestoreProjectStyle is a property that can be used to opt-in projects into PackageReference but it needs officially cleared up in #4488

@nkolev92 nkolev92 added Resolution:Duplicate This issue appears to be a Duplicate of another issue and removed Triage:NeedsTriageDiscussion labels Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Restore Priority:2 Issues for the current backlog. Resolution:Duplicate This issue appears to be a Duplicate of another issue Type:Bug
Projects
None yet
Development

No branches or pull requests

4 participants