Skip to content

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

Closed
NuGet/NuGet.Client
#4076

Description

@nkolev92

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

Activity

  1. added
    Priority:2
    on Nov 2, 2020
  2. added
    Priority:1
    and removed
    Priority:2
    on Nov 3, 2020
  3. nkolev92 commented on Nov 19, 2020

    @nkolev92
    MemberAuthor

    Spec in review at #10299.

    There are some questions left in there.

  4. added
    Resolution:BlockedByExternal
    on Feb 1, 2021
  5. nkolev92 commented on Feb 1, 2021

    @nkolev92
    MemberAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Functionality:RestorePartner:C++Partner:Project-SystemPriority:1Product:VS.ClientResolution:BlockedByExternalStyle:PackageReferenceType:DCR

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions