this is as close as I've gotten to building Hippo in NixOS
Can't get past the errors:
MSB4242: The SDK resolver "Microsoft.DotNet.MSBuildSdkResolver" failed to run
and
warning NU1701: Package was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
and
[CS0012] The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
I thought it was related to the old 6.0 version of Mono in nixpkgs, but checking out this PR for 6.10 locally and pointing this shell.nix at it didn't help with the errors: NixOS/nixpkgs#93043
(mono --version
did report 6.10
in the shell)
The project builds fine on Ubuntu and MacOS, so it's unlikely that some .csproj
or other project
file needs to be changed; more likely there's something that Nix isn't providing (the "resolver"?)
also the version of Rider from nixpkgs fails to start (java exception?), so instead I've been using:
nix run -f https://github.com/NixOS/nixpkgs/archive/b90dfdab83c196f479c2eb2209031585e7d961fc.tar.gz jetbrains.rider -c rider
Related Discourse post here
However, the netstandard.dll should IMO be referenced by default (by the msbuild/csc), just like mscorlib is.
That is done by our internal tooling by default. If this is not being done in your project, it means that we were not able to detect that the project depends on netstandard.dll facade, which might be the case when the netstandard dependent assembly is comming in as a transitive dependency and your project is using old tooling (like packages.config instead of PackageReference for example)
Add the Nuget package Microsoft.NETFramework.ReferenceAssemblies
1.0.0 to the packages that are broken, and from the shell.nix remove mono and the export FrameworkPathOverride=
bit.
Still not sure why it worked without that package on other Linux machines and not on NixOS... Was I not setting mono up correctly?
helpful stuff: