Is it possible to remove the full-paths from .NET assemblies created with dotnet build?

You can configure a release build with less information or you can override PathMap value to override it.

<PropertyGroup Label="Override Stack trace file locations">
  <PathMap>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)'))=./</PathMap>
</PropertyGroup>

The following Directory.Build.props in the root of the project should work:

<Project>
 <PropertyGroup>
    <Deterministic>true</Deterministic>
    <DeterministicSourcePaths>true</DeterministicSourcePaths>
    <PathMap>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)'))=./</PathMap>
 </PropertyGroup>
</Project>

C# compiler (csc) has a compiler switch -deterministic

F# compiler (fsc) appears to have a switch --deterministic+

From looking at the DotNet SDK repo it appears there are 2 properties for project files:

<Deterministic>true</Deterministic>
<DeterministicSourcePaths>true</DeterministicSourcePaths>

You might not need both of these.