Open
Description
Describe the bug
.NET 10 Preview 6 did not generate the exe/AppHost when <PackAsTool>true</PackAsTool>
, it works when using .NET 10 Preview 5
sample CI build: https://github.com/WeihanLi/dotnet-exec/actions/runs/16307191846/job/46055675418
To Reproduce
dotnet new console -n ExeTest
add <PackAsTool>true</PackAsTool>
to the project
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackAsTool>true</PackAsTool>
</PropertyGroup>
</Project>
run dotnet publish
dotnet publish -o artifacts/out
There's no AppHost generated when publishing in .NET 10 Preview 6, but there's before, not sure if it's by design

Workaround: specify UseAppHost=true
explicitly
dotnet publish -o artifacts/out -p UseAppHost=true
Further technical details
- Include the output of
dotnet --info
.NET SDK:
Version: 10.0.100-preview.6.25358.103
Commit: 75972a5ba7
Workload version: 10.0.100-manifests.b6c7f53e
MSBuild version: 17.15.0-preview-25358-103+75972a5ba
Runtime Environment:
OS Name: Mac OS X
OS Version: 14.7
OS Platform: Darwin
RID: osx-arm64
Base Path: /Users/runner/.dotnet/sdk/10.0.100-preview.6.25358.103/
.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
Workloads are configured to install and update using workload versions, but none were found. Run "dotnet workload restore" to install a workload version.
Host:
Version: 10.0.0-preview.6.25358.103
Architecture: arm64
Commit: 75972a5ba7
.NET SDKs installed:
8.0.101 [/Users/runner/.dotnet/sdk]
8.0.204 [/Users/runner/.dotnet/sdk]
8.0.303 [/Users/runner/.dotnet/sdk]
8.0.412 [/Users/runner/.dotnet/sdk]
9.0.102 [/Users/runner/.dotnet/sdk]
9.0.203 [/Users/runner/.dotnet/sdk]
9.0.302 [/Users/runner/.dotnet/sdk]
10.0.100-preview.6.25358.103 [/Users/runner/.dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.1 [/Users/runner/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.4 [/Users/runner/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.7 [/Users/runner/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.18 [/Users/runner/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.1 [/Users/runner/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.4 [/Users/runner/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.7 [/Users/runner/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.0-preview.6.25358.103 [/Users/runner/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.1 [/Users/runner/.dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.4 [/Users/runner/.dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.7 [/Users/runner/.dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.18 [/Users/runner/.dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.1 [/Users/runner/.dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.4 [/Users/runner/.dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.7 [/Users/runner/.dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.0-preview.6.25358.103 [/Users/runner/.dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
DOTNET_ROOT [/Users/runner/.dotnet]
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download