Created
February 27, 2022 20:55
-
-
Save whb07/ecdf7c4770bef85f30335d03af749391 to your computer and use it in GitHub Desktop.
Creating a single executable file for .net framework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net472</TargetFramework> | |
</PropertyGroup> | |
<ItemGroup> | |
<Compile Include="Program.fs" /> | |
</ItemGroup> | |
<ItemGroup> | |
<PackageReference Include="ilmerge" Version="3.0.41" /> | |
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" /> | |
</ItemGroup> | |
<Target Name="ILMerge"> | |
<!-- the ILMergePath property points to the location of ILMerge.exe console application --> | |
<Exec Command="$(ILMergeConsolePath) /out:$(ProjectDir)\path_to_save\$(TargetFileName) $(ProjectDir)\bin\Release\net472\$(TargetFileName) ^ | |
$(ProjectDir)\bin\Release\net472\*.dll ^ | |
/wildcards" /> | |
</Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment