Other F# , dotnet publish to self contained executable error.

On linux it works fine.
On FreeBSD i've got the error:

MSBuild version 17.8.5+b5265ef37 for .NET
Determining projects to restore...
/mnt/xxx_source/Languages_ok/fsharptut/01_exe/fsharp_test.fsproj : error NU1102: Unable to find package Microsoft.NETCore.App.Crossgen2.freebsd-x64 with version (= 8.0.6)
/mnt/xxx_source/Languages_ok/fsharptut/01_exe/fsharp_test.fsproj : error NU1102: - Found 1 version(s) in Package source 1 [ Nearest version: 7.0.15 ]
/mnt/xxx_source/Languages_ok/fsharptut/01_exe/fsharp_test.fsproj : error NU1102: - Found 0 version(s) in /usr/local/dotnet/sdk/8.0.106/FSharp/library-packs
/mnt/xxx_source/Languages_ok/fsharptut/01_exe/fsharp_test.fsproj : error NU1102: - Found 0 version(s) in nuget.org
Failed to restore /mnt/xxx_source/Languages_ok/fsharptut/01_exe/fsharp_test.fsproj (in 1,1 sec).

Project file
Code:
cat fsharp_test.fsproj 
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <PublishReadyToRun>true</PublishReadyToRun>
    <SelfContained>true</SelfContained>
    <PublishSingleFile>true</PublishSingleFile>
    <PublishTrimmed>true</PublishTrimmed>
    <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
    <OutputType>Exe</OutputType>
    <TrimMode>partial</TrimMode>
    <TargetFramework>net8.0</TargetFramework>
    <InvariantGlobalization>true</InvariantGlobalization>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="Program.fs" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="FSharp.Data" Version="6.4.0" />
  </ItemGroup>

</Project>
 
The port generates that package but does not install it.
You can not use "PublishReadyToRun" without Crossgen2
You can not use "NativeAOT" without ILC
Either set "PublishReadyToRun" to false or grab the Crossgen2 NuGet from ports (or community member)
 
Back
Top