How do I create a simple f# netcoreapp using .NET Core 3.0 or 3.1. and have an application icon show up when viewed in Windows explorer?
This is like a question posed before but the solutions doesn't seem to be working for an application built using .NET Core 3.0 or 3.1 sdks.
I have created a resource file and attempt to compile the application and add the icon resource using the the command line:
fsc Program.fs --win32res:AppIcon.res --target:exe
In this case the application compiles but I don't get a Windows explorer icon.
I've also tried to build and publish using the dotnet cli with the fsproj file below (dotnet publish ConsoleApp1.fsproj -c Release --self-contained -r win7-x64 -o publish)
In this case the project does not compile and I get an error "error MSB4018: The "CreateAppHost" task failed unexpectedly".
Any help would be greatly appreciated!
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<Win32Resource></Win32Resource>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OtherFlags>--win32res:AppIcon.res</OtherFlags>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\rebalance.ico" />
<Resource Include="AppIcon.res">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Compile Include="Program.fs" />
</ItemGroup>
</Project>