Reputation: 1305
I have a .NET 3.1 console application. I use the Visual Studio Code IDE. I build the executable with dotnet publish
(+ some arguments) from command line. I want the built .exe file to have my custom icon (.ico file).
What do I need to do to have the built .exe my custom icon?
Upvotes: 3
Views: 2931
Reputation: 518
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<ApplicationIcon>TextTemplate.ico</ApplicationIcon>
</PropertyGroup>
</Project>
In my example, the file is at project root. if you place it in a subfolder, you might need to deal with the path accordingly
Upvotes: 8