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

NuGet effective target framework inference support for C++/CLI projects #10194

Closed
nkolev92 opened this issue Oct 27, 2020 · 2 comments · Fixed by NuGet/NuGet.Client#4076
Closed
Assignees
Labels
Functionality:Restore Partner:C++ Partner:Project-System Priority:1 High priority issues that must be resolved in the current sprint. Product:VS.Client Resolution:BlockedByExternal Progress on this task is blocked by an external issue. When that issue is completed this can proceed Style:PackageReference Type:DCR Design Change Request

Comments

@nkolev92
Copy link
Member

This is a task that's supposed to help the C++ & project-system partners to fully implement #8195.

C++ projects have a complex framework approach.

Per @olgaark:

TargetFramework*/TargetPlatform* properties for C++/CLI are pretty much the same as for c#, so they should be used in nuget instead of just checking for .vcxproj extension. Also, C++/CLI can use/reference not only managed, but native code as well, so “native” packages should be allowed together with the appropriate managed ones.

You can use the following properties to distinguish vc projects:

TargetPlatformIdentifier/Version/Moniker should be defined for all vc projects.
CLRSupport
False or empty – native project
NetCore – C++/CLI .NET Core project
Everything else (true, safe, etc) - C++/CLI .NET Framework project
TargetFramework is only defined for C++/CLI .NET Core projects.
TargetFrameworkIdentifier/Version/Moniker properties are defined for C++/CLI .NET Framework projects. Note, that they are also confusingly defined for pure native ones too (in msbuild common targets, at least, they used to be), so you need to check other properties first (i.e. TargetPlatformIdentifier and CLRSupport). You can also use project capabilities: “native” vs “managed”

Affected codepath: https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Commands/Utility/MSBuildProjectFrameworkUtility.cs

Related work:

NuGet/NuGet.Client#3644
NuGet/NuGet.Client#3618

dotnet/project-system#2491

@nkolev92
Copy link
Member Author

Spec in review at #10299.

There are some questions left in there.

@nkolev92 nkolev92 added the Resolution:BlockedByExternal Progress on this task is blocked by an external issue. When that issue is completed this can proceed label Feb 1, 2021
@nkolev92
Copy link
Member Author

nkolev92 commented Feb 1, 2021

Prototype in https://github.com/NuGet/NuGet.Client/tree/dev-nkolev92-cppCliFrameworkSupport.

Prototype provided to the C++/CLI team, action is on their side right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Restore Partner:C++ Partner:Project-System Priority:1 High priority issues that must be resolved in the current sprint. Product:VS.Client Resolution:BlockedByExternal Progress on this task is blocked by an external issue. When that issue is completed this can proceed Style:PackageReference Type:DCR Design Change Request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants