Skip to content

.NET Core 3.1.103 for FreeBSD

Jason Pugsley edited this page May 6, 2020 · 2 revisions

See Build .NET SDK 3.1.103 for FreeBSD if you'd like to rebuild this from scratch.

This follows on from earlier work to get .NET Core 3 running on FreeBSD. It is not production ready, you will likely come across bugs. By all means use it to experiment with, I have mostly used it to build .NET Core and a few other tools.

Download

You'll need the SDK itself - 3.1.103 SDK

You will most likely need these packages as well for anything non-trivial - Packages

You can extract the SDK to anywhere but the canonical location is into /usr/share/dotnet Add that directory to your PATH

FreeBSD Dependencies

Install this list of packages from ports. sudo pkg install libunwind lttng-ust icu curl openssl libinotify git cmake krb5 When I have time I'll recheck on a fresh install to see if all of them are still required.

Package Cache

The packages are necessary because they have extra code that sits outside of the SDK. You have to ensure that the downloaded packages are always preferenced first. This is because official packages hosted on the internet are not aware of the FreeBSD packages - FreeBSD is not in the official dependency graph.

Extract the downloaded packages to a directory and edit the global NuGet config to use that location.

$ cat ~/.nuget/NuGet/NuGet.Config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="local_pkgs" value="/home/username/dotnet_pkgs_3.1.103" />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
</configuration>

If your application has its own NuGet.config then make the change there as well.

Clone this wiki locally