Skip to content

Engineering Tech Blog

Menu
Menu

Compile Standalone EXE file in Visual Studio

Posted on September 20, 2026September 20, 2026 by aschenbach

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

Category: Blog, dotnet

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • File size identifying Windows tools
  • PHP Security patch
  • Mozilla Browsers
  • Python Windows install scripts v3.15.0
  • Python 3.15.0 release

Recent Comments

No comments to show.

Archives

  • October 2026
  • September 2026
  • August 2026
  • July 2026
  • June 2026
  • May 2026
  • April 2026
  • March 2026
  • February 2026
  • January 2026

Categories

  • Blog
  • browsers
  • chromebook
  • Code
  • dart
  • dotnet
  • linux
  • php
  • python
  • ruby
  • windows
  • wordpress
© 2026 Engineering Tech Blog | Powered by Minimalist Blog WordPress Theme