Reputation: 9714
I have only used the dotnet
line commands, both to generate projects and to generate "solutions" (.sln
), however I don't know if it is possible to use resource.rc
directly withdotnet
with something like:
MAINICON ICON "icon.ico"
The question is, how can I add with resource.rc
(or other means) an icon for a standard .NET-core application?
Will I need any tools other than dotnet
(CLI) for this?
Upvotes: 7
Views: 6848
Reputation: 9714
Today I did a test and apparently the tag works on netcoreapp3.1
:
<ApplicationIcon>nome.ico</ApplicationIcon>
Obviously the project has to be an application, in my case I created a "console" application like this:
mkdir projeto1
cd projeto1
dotnet new console
So I was generated projeto1.csproj
, I opened it and edited this way:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<ApplicationIcon>nome.ico</ApplicationIcon>
</PropertyGroup>
</Project>
So then I ran dotnet run and using both the c Debug and c Release flags (and publish also) this works, the example I did:
So I ran dotnet build
and got the desired one:
Upvotes: 21