NuGet effective target framework inference support for C++/CLI projects #10194
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
Milestone
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
The text was updated successfully, but these errors were encountered: