Reputation: 5602
How can I embed application manifest with my F# application? With C# projects it can be specified in projects properties but I haven't found any similar in F# project.
Upvotes: 3
Views: 491
Reputation: 786
With VS 2015 and F# 4 (I haven't tested earlier versions, but it probably also works in them) both the compiler and the MSBuild files directly support embedding a manifest in an exe, the option is just not surfaced on the GUI.
You can just add the manifest as a normal file and add the following to your project file:
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
This adds the following parameter to the call to the compiler: --win32manifest:app.manifest
Upvotes: 2
Reputation: 5602
I've ended up modifying my fsproj
-file to contain the following at the end:
<Target Name="AfterBuild">
<Exec Command=""C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\mt.exe" -manifest App.manifest -outputresource:"$(TargetPath)""
Condition="('$(OutputType)' == 'Exe' Or '$(OutputType)' == 'WinExe') And Exists('App.manifest')" />
</Target>
Upvotes: 1
Reputation: 4280
Probably the easyest way is using mt.exe tool (Section 2 in this post http://blogs.msdn.com/b/cheller/archive/2006/08/24/how-to-embed-a-manifest-in-an-assembly-let-me-count-the-ways.aspx)
Upvotes: 1