Repository navigation
Closed
Labels
Milestone
Description
Description
When AOT publishing without Windows 11 SDK installed, the compilation fails with an unclear error message.
Variable is set to invalid string:
$(CppLinker)="The system cannot find the file specified.%3bC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\link.exe"
Reproduction Steps
- Install Visual Studio 2022.
Deselect (any instance of) Optional Component Windows 11 SDK under Desktop development with C++. - Create project:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishAot>true</PublishAot>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
</Project>- Publish using command:
dotnet publish .\p.csproj -r win-x64 -c releaseExpected behavior
Error message indicating that Windows 11 SDK needs to be installed.
Actual behavior
Target .NET 8
$ dotnet publish .\p.csproj -r win-x64 -c release
Restore complete (0.5s)
info NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
p failed with 1 error(s) (4.0s) → bin\release\net8.0\win-x64\p.dll
C:\Users\steve\.nuget\packages\microsoft.dotnet.ilcompiler\8.0.20\build\Microsoft.NETCore.Native.targets(370,5): error MSB3073: The command ""The system cannot find the file specified.;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\link.exe" @"obj\release\net8.0\win-x64\native\link.rsp"" exited with code 123.
Build failed with 1 error(s) in 5.1s
Target .NET 10
$ dotnet publish .\p.csproj -r win-x64 -c release
Restore complete (1.0s)
info NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
p failed with 1 error(s) (9.3s) → bin\release\net10.0\win-x64\p.dll
C:\Users\steve\.nuget\packages\microsoft.dotnet.ilcompiler\10.0.0-rc.1.25451.107\build\Microsoft.NETCore.Native.targets(396,5): error MSB3073: The command ""The system cannot find the file specified.;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\link.exe" @"obj\release\net10.0\win-x64\native\link.rsp"" exited with code 123.
Build failed with 1 error(s) in 11.0s
1:7>Target "SetupOSSpecificProps" in file "C:\Users\steve\.nuget\packages\microsoft.dotnet.ilcompiler\10.0.0-rc.1.25451.107\build\Microsoft.NETCore.Native.Windows.targets" from project "C:\source\p.csproj" (target "WriteIlcRspFileForCompilation" depends on it):
Using "Exec" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "Exec"
"C:\Users\steve\.nuget\packages\microsoft.dotnet.ilcompiler\10.0.0-rc.1.25451.107\build\findvcvarsall.bat" x64
The system cannot find the file specified.
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\#
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64
Done executing task "Exec".
C:\Users\steve\.nuget\packages\microsoft.dotnet.ilcompiler\10.0.0-rc.1.25451.107\build\Microsoft.NETCore.Native.Windows.targets(138,7): message : Property reassignment: $(CppLinker)="The system cannot find the file specified.%3bC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\link.exe" (previous value: "link") at C:\Users\steve\.nuget\packages\microsoft.dotnet.ilcompiler\10.0.0-rc.1.25451.107\build\Microsoft.NETCore.Native.Windows.targets (138,7) [C:\source\p.csproj]
C:\Users\steve\.nuget\packages\microsoft.dotnet.ilcompiler\10.0.0-rc.1.25451.107\build\Microsoft.NETCore.Native.Windows.targets(139,7): message : Property reassignment: $(CppLibCreator)="The system cannot find the file specified.%3bC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\lib.exe" (previous value: "lib") at C:\Users\steve\.nuget\packages\microsoft.dotnet.ilcompiler\10.0.0-rc.1.25451.107\build\Microsoft.NETCore.Native.Windows.targets (139,7) [C:\source\p.csproj]
$ .\findvcvarsall.bat x64
The system cannot find the file specified.
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\#
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64
Regression?
No response
Known Workarounds
Install Windows 11 SDK
Configuration
$ dotnet --version
10.0.100-rc.1.25451.107
$ dotnet --list-sdks
9.0.305 [C:\Program Files\dotnet\sdk]
10.0.100-rc.1.25451.107 [C:\Program Files\dotnet\sdk]
Windows 10 22H2 x64
Other information
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
MihuBot commentedon Oct 1, 2025
I'm a bot. Here is a possible related and/or duplicate issue (I may be wrong):
dotnet-policy-service commentedon Oct 1, 2025
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.
AOT publishing: Improve error message when the Windows SDK is missing (…
AOT publishing: Improve error message when the Windows SDK is missing (…