-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
Description
Description
When publishing C# applications with AOT and only VS 2026 is installed, the findvcvarsall.bat file throws an error. Please implement #115951 into .NET 8 and .NET 9, as the Microsoft.DotNet.ILCompiler toolset throws errors when publishing applications
Reproduction Steps
Steps to Reproduc
- Only install VS 2026
- Install .NET 9
- Include the "Desktop Development with C++" workload via installer
- Include the ".NET Desktop Development" workload via installer
- Publish an application with AOT
dotnet publish TestApp.csproj /p:PublishProfile=TestApp/PublishProfiles/win-x64.pubxml
Sample win-x64.pubxml
<?xml version="1.0" encoding="utf-8"?>
<!-- https://go.microsoft.com/fwlink/?LinkID=208121. -->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>../publish/cli/win-x64</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<TargetFramework>net9.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishReadyToRun>false</PublishReadyToRun>
<PublishSingleFile>false</PublishSingleFile>
</PropertyGroup>
</Project>Expected behavior
Not to fail.
Use the methodology in, #115951
Actual behavior
Throws error stating, "Make sure to install the Desktop Development for C++ workload. For ARM64 development also install C++ ARM64 build tools." Even through they are already installed.
Regression?
No response
Known Workarounds
Manually edit Line 18 in, findvcvarsall.bat, removing the line -version [16^,18^) ^
FOR /F "tokens=*" %%i IN (
'"%vswherePath%" -latest -prerelease -products * ^
-requires Microsoft.VisualStudio.Component.VC.Tools.%toolsSuffix% ^
-version [16^,18^) ^
-property installationPath'
) DO SET vsBase=%%iConfiguration
No response
Other information
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status