I still have the same issue that I reported at https://github.com/fsharp/fsharp/issues/868.
Related issue might be https://github.com/dotnet/fsharp/issues/6007
Previously when I used Mono's xbuild I got only FSharp.Core.dll and some other needed dll files into the output directory, i.e only the things needed to run the program. After seeing the _deprecation_ warnings during builds I switched to msbuild, but problem is that now these extra directories started to appear in the output directory:
drwxrwxr-x. 2 mclang 38 2019-05-17 06:55 cs/
drwxrwxr-x. 2 mclang 38 2019-05-17 06:55 de/
drwxrwxr-x. 2 mclang 38 2019-05-17 06:55 en/
drwxrwxr-x. 2 mclang 38 2019-05-17 06:55 es/
drwxrwxr-x. 2 mclang 38 2019-05-17 06:55 fr/
drwxrwxr-x. 2 mclang 38 2019-05-17 06:55 it/
drwxrwxr-x. 2 mclang 38 2019-05-17 06:55 ja/
drwxrwxr-x. 2 mclang 38 2019-05-17 06:55 ko/
drwxrwxr-x. 2 mclang 38 2019-05-17 06:55 pl/
drwxrwxr-x. 2 mclang 38 2019-05-17 06:55 pt-BR/
drwxrwxr-x. 2 mclang 38 2019-05-17 06:55 ru/
drwxrwxr-x. 2 mclang 38 2019-05-17 06:55 tr/
drwxrwxr-x. 2 mclang 38 2019-05-17 06:55 zh-Hans/
drwxrwxr-x. 2 mclang 38 2019-05-17 06:55 zh-Hant/
Each of these directories contain only singe file, FSharp.Core.resources.dll library, that seems not to be needed because the program works also without them.
In addition some extra XML files started also to be copied into the output directory, like these:
-rw-rw-r--. 1 mclang 760K 2019-02-13 23:34 FSharp.Core.xml
-rw-rw-r--. 1 mclang 444K 2019-03-01 00:03 Google.Protobuf.xml
-rw-rw-r--. 1 mclang 802K 2019-01-28 07:41 MySql.Data.xml
-rw-rw-r--. 1 mclang 1.5M 2018-11-06 17:07 NLog.xml
This happens whether I build directly using msbuild or with FAKE. The program in question use only plain English localisation, so no extra language resources should be needed.
Is there something I can do in the code to make msbuild to skip these files?
I got rid of the XML files by adding this into the debug and release sections of the fsproj file:
<AllowedReferenceRelatedFileExtensions>
.mdb
.pdb
</AllowedReferenceRelatedFileExtensions>
For removing the unnecessary directories I added this section in to he fsproj file:
<Target Name="AfterBuild">
<ItemGroup>
<FSharpCoreResourcesFiles Include="$(OutputPath)**\FSharp.Core.resources.dll" />
<FSharpCoreResourcesDirs Include="@(FSharpCoreResourcesFiles->'\%(Directory)') " />
</ItemGroup>
<RemoveDir Directories="@(FSharpCoreResourcesDirs)" />
</Target>
@mclang
if you are using the new sdk-style project format you can add this property to your project
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
this should ensure that these resource dlls are not deployed
Closing as duplicate of https://github.com/dotnet/fsharp/issues/6007
Most helpful comment
@mclang
if you are using the new sdk-style project format you can add this property to your project
this should ensure that these resource dlls are not deployed