This one is quite fascinating, generally speaking i had been able to use the exe file from .\bin\debug when creating a project using the default template creation process in VS 2022 for a console application. Lately, it doesn’t seem to work. I would need to publish it to win-x64.
dotnet new console -n YourAppName –framework net10.0
<Project Sdk=”Microsoft.NET.Sdk”>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<!– Forces the app to build into a single executable –>
<PublishSingleFile>true</PublishSingleFile>
<!– Trims unused code to reduce the self-contained file size –>
<PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>
</Project>
dotnet publish -c Release -r win-x64 –self-contained true