You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
For C++/CLI PackageReference projects, NuGet should ignore the TargetPlatformMoniker #11808
Hi, @nkolev92
Could you elaborate why the TargetPlatformMoniker is ignored? I have tried to follow all the links and could not find the "recent discussion" that came to this conclusion.
We are currently trying to migrate a mixed C++/CLI & C# solution from .NET Framework to .NET 7 and PackageReference and we noticed that our C++/CLI projects are unable to reference any C# libraries that target net7.0-windows. This is a blocking issue. The MSBuild output shows that TargetPlatformMoniker of the C++/CLI project is set to Windows,Version=7.0 but NuGet gives a NU1202 error stating that net7.0 is not compatible with the referenced net7.0-windows7.0 library.
I am unsure if we are doing something wrong or if this is a known limitation but after a lot of research I've come to the conclusion that this change right here may be the cause. This is especially confusing since C++/CLI is known to be supported only on Windows according to the documentation.
Thanks for the quick reply. I downloaded the latest dev branch including the changes from the new PR and did a quick test with the nuget cli. Restore works, assets.json points to net7.0-windows10.0.22621 instead of net7.0. Looking good!
I hope NuGet 6.7 is out soon, in the meantime I'll use my local build. We still have a lot of obstacles to clear and having a working package restore was one of the major roadblocks. Also looking forward to VS 17.7.
Activity
X-Celcius commentedon Jul 10, 2023
Hi, @nkolev92
Could you elaborate why the TargetPlatformMoniker is ignored? I have tried to follow all the links and could not find the "recent discussion" that came to this conclusion.
We are currently trying to migrate a mixed C++/CLI & C# solution from .NET Framework to .NET 7 and PackageReference and we noticed that our C++/CLI projects are unable to reference any C# libraries that target net7.0-windows. This is a blocking issue. The MSBuild output shows that TargetPlatformMoniker of the C++/CLI project is set to Windows,Version=7.0 but NuGet gives a NU1202 error stating that net7.0 is not compatible with the referenced net7.0-windows7.0 library.
I am unsure if we are doing something wrong or if this is a known limitation but after a lot of research I've come to the conclusion that this change right here may be the cause. This is especially confusing since C++/CLI is known to be supported only on Windows according to the documentation.
Thanks!
nkolev92 commentedon Jul 10, 2023
@X-Celcius
This was superseded by #12521.
The changes will come in 17.7.
X-Celcius commentedon Jul 10, 2023
Thanks for the quick reply. I downloaded the latest dev branch including the changes from the new PR and did a quick test with the nuget cli. Restore works, assets.json points to net7.0-windows10.0.22621 instead of net7.0. Looking good!
I hope NuGet 6.7 is out soon, in the meantime I'll use my local build. We still have a lot of obstacles to clear and having a working package restore was one of the major roadblocks. Also looking forward to VS 17.7.
Thanks again!