Missing assembly in buildDotnetModule buildPhase

Hi Nix`ers,

Am trying to build the Azure Pipeline Agent which is a dotnet application, it has quite some similarities with Github Runner.
Github runner is already available on nixpkgs

I have created a dependency file through nuget-to-nix and used mostly the same setup as the github-runner nix pkg.
The configure phase (restore) looks successfully, but in the build phase i get an error of a missing reference.

Error:

/build/src/src/Agent.Sdk/Util/ProcessUtil.cs(8,14): error CS0234: The type or namespace name 'Management' does not exist in the namespace 'System' (are you missing an assembly reference?) [/build/src/src/Agent.Sdk/Agent.Sdk.csproj]

I have set the PackageRuntime to linux-x64, cause System.Management is a Windows thing(?), it shouldn’t be called/used in the build phase? The reference is also missing in the restored csproj file in /build/src/src/Agent.Sdk/Agent.Sdk.csproj so that looks all correctly…

Tried to:

  • Remove the “using System.Management” line but it is giving me errors further down the file.
  • patch the Common.props file to only set linux params as OS and ARCH.
  • Overwriting the Agent.Sdk.csproj file in the /build/src directory with the package reference

Am stuck here; what can i do to debug this more?

My project can be found on github: GitHub - rudesome/ado-agent: Azure DevOps Agent packaged with Nix
Source project: GitHub - microsoft/azure-pipelines-agent: Azure Pipelines Agent 🚀