In reply to <a href="https://devblogs.microsoft.com/cppblog/nuget-packagereference-for-c-projects-in-visual-studio/#comment-2788">Jonas Frank</a>.
No, we don't expect to be able to fix them in time for 18.7 GA. We will continue tracking this to fix in a future release.
Native C++ projects in Visual Studio now support <PackageReference>, the modern, MSBuild-native way to declare NuGet package dependencies directly in your project file. This support is available experimentally for .vcxproj projects in the Visual Studio Insiders Channel starting with version 18.7.
This feature has been the most upvoted feature request on Visual Studio Developer Community, and we’re delivering it based on that feedback and in collaboration with other teams at Microsoft, including Windows and Azure.
NuGet with PackageReferences can be useful for teams that develop both .NET and C++ projects (native or interop) that need a consistent way to deploy their binaries across their repos or to their consumers, or for managing dependencies that aren’t C++ libraries, such as binary SDK packages. We continue to recommend vcpkg for acquiring and managing C++ libraries, as it is more specialized and flexible for these types of dependencies.
Traditionally, NuGet packages in C++ projects were managed through packages.config, a separate XML file that listed every dependency (including transitive ones) and required a per-solution packages folder. PackageReference eliminates that by declaring dependencies directly in the project file:
<ItemGroup>
<PackageReference Include="Microsoft.Windows.CppWinRT" Version="2.0.240405.15" />
</ItemGroup>
The key advantages over packages.config:
For a full overview, see the PackageReference documentation on Microsoft Learn. If you’re migrating an existing project, see Migrate from packages.config to PackageReference.
Once enabled, this experience is identical to .NET projects, both in the Visual Studio IDE and on the command line. There is no difference in the core UX. You can add PackageReferences by:
<PackageReference> items to an <ItemGroup> in your .vcxproj.Install-Package commands.NuGet restore handles downloading, caching, and making package assets available to your build. The underlying implementation uses core CPS (Common Project System) capabilities, the same infrastructure that powers this feature for .NET projects.
This feature is experimental and off by default in version 18.7. To opt in, set the EnableNativePackageReferenceSupport MSBuild property to true.
You can do this in your project file’s Globals property group:
<PropertyGroup Label="Globals">
<EnableNativePackageReferenceSupport>true</EnableNativePackageReferenceSupport>
</PropertyGroup>
Or, to enable it across all projects in a repository, add it to a Directory.Build.props file:
<Project>
<PropertyGroup>
<EnableNativePackageReferenceSupport>true</EnableNativePackageReferenceSupport>
</PropertyGroup>
</Project>
We designed this feature to be fully compatible with the project load performance improvements shipped since Visual Studio 2017. One of the things holding us back from shipping PackageReference in the past was that a simpler implementation would invalidate this work, causing ongoing performance regressions for customers. Happily, this problem is now solved. The first time you add PackageReferences to a project, there is a one-time cache warm-up cost. After that initial load, the cache is warm and subsequent project operations are fully optimized with no ongoing performance impact.
This initial release supports native C++ projects (.vcxproj). The following scenarios are not yet supported:
<ReferenceOutputAssembly>false</ReferenceOutputAssembly> and <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties> on the <ProjectReference> item, which will allow NuGet to ignore it and not cause restore and build issues.AssetTargetFallback to include frameworks compatible with the referenced C# project. For example:
<PropertyGroup>
<AssetTargetFallback>net472;net10.0</AssetTargetFallback>
</PropertyGroup>
This feature does not change our recommendation for vcpkg. We continue to recommend vcpkg as the primary tool for acquiring and managing C and C++ libraries. vcpkg provides source-based builds with binary caching support, ABI compatibility management, support for offline installation, and a curated registry of thousands of open-source libraries optimized for C++ workflows.
PackageReference support complements vcpkg by enabling NuGet-based distribution workflows. For example, teams that publish internal SDK packages via NuGet feeds, or projects that consume Windows-specific packages distributed through NuGet.org. The two tools serve different use cases and work well together. You can also use vcpkg to build library dependencies, then export them as NuGet with the vcpkg export --nuget command.
EnableNativePackageReferenceSupport to true in your project or Directory.Build.props..vcxproj and build.We want your feedback. This is an experimental release, and your input will directly shape how we evolve this feature before enabling it by default. Let us know:
You can share feedback through Developer Community, the blog comments below, or Help → Send Feedback in Visual Studio.
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | Comment on NuGet PackageReference for C++ Projects in Visual Studio by Jonas Frank | -3 | 3 | 01-06-2026 |
| 2 | Comment on What’s New for C++ Developers in Visual Studio 2026 (18.1 – 18.6) by Yusverlin Quintana | 0 | 0 | 05-06-2026 |
| 3 | Comment on Segment Heap support for C++ projects in Visual Studio by Mehmet Iyigun | 5 | 7 | 28-05-2026 |
| 4 | Comment on Boosting Adobe Photoshop’s Performance with MSVC and SPGO by Pratap Chandar | 0 | 5 | 06-07-2026 |
| 5 | Comment on Streamline C++ Code Intelligence Setup in Copilot CLI by Alexander Kleine | 0 | 1 | 25-06-2026 |
| 6 | GCC 16.2 Being Planned For Early August Release | 0 | 5 | 01-07-2026 |
| 7 | misc/dartsim - 6.19.2_1 | 0 | 5 | 13-07-2026 |
| 8 | Feature request: copy / paste element properties | 0 | 5 | 13-07-2026 |
| 9 | textproc/tree-sitter-grammars - 0.4.2_7 | 0 | 5 | 13-07-2026 |
| 10 | misc/py-langchain-classic - 1.0.8 | 0 | 5 | 13-07-2026 |