-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Description
Type of issue
Missing information
Description
An user in the C# Discord had the problem that they couldn't publish a .NET 9.0 project with VS2026. It gave the following error:
C:\Users....nuget\packages\microsoft.dotnet.ilcompiler\9.0.11\build\Microsoft.NETCore.Native.Windows.targets(138,5): error Platform linker not found. Ensure you have all the required prerequisites documented at https://aka.ms/nativeaot-prerequisites, in particular the Desktop Development for C++ workload in Visual Studio. For ARM64 development also install C++ ARM64 build tools.
In the link it's saying:
Prerequisites
[Windows]
Visual Studio 2022 or later, including the Desktop development with C++ workload with all default components.
The user did in fact install a later version; VS2026, however, there is a VS version check in the AOT compiler that checks for VS2022.
Issue in the Developer Community: https://developercommunity.visualstudio.com/t/AOT-Publish-Issue-while-target-NET-9-an/11000135
This has been fixed in dotnet/runtime in:
- [release/9.0-staging] Simplify findvcvarsall.bat runtime#120913 (.NET 9.0)
- [release/8.0-staging] Simplify findvcvarsall.bat runtime#120914 (.NET 8.0)
However:
- At the time of writing the fixes are not yet released in a new SDK;
- Users that have older SDKs installed will still have this issue;
- This won't be fixed for .NET versions that are EOL (e.g. .NET 6.0).
Should this information be included on this page that the SDK should be updated, and that VS2022 should be installed/used for older SDK versions?
Page URL
Content source URL
https://github.com/dotnet/docs/blob/main/docs/core/deploying/native-aot/index.md
Document Version Independent Id
54aa95cb-2d5b-85c9-6c34-1fc0348f7cb1
Platform Id
9b2082cc-ea88-5fa5-ebe1-07b81f70a58a
Article author
Metadata
- ID: 63476200-2ede-1779-9cc9-1503efec1b36
- PlatformId: 9b2082cc-ea88-5fa5-ebe1-07b81f70a58a
- Service: dotnet-fundamentals