FS#63636 - Unable to build projects with mono 6.0
Attached to Project:
Arch Linux
Opened by Rokas Kupstys (rokups) - Tuesday, 03 September 2019, 08:26 GMT
Last edited by Balló György (City-busz) - Thursday, 08 June 2023, 21:55 GMT
Opened by Rokas Kupstys (rokups) - Tuesday, 03 September 2019, 08:26 GMT
Last edited by Balló György (City-busz) - Thursday, 08 June 2023, 21:55 GMT
|
Details
Attempt to build any C# project with msbuild results in an
error about missing
/usr/lib/mono/msbuild/15.0/bin/Roslyn/Microsoft.CSharp.Core.targets
file.
Package version: mono 6.0.0.319-1 1. Create file foo.csproj with content: <Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0"> </Project> 2. "msbuild foo.csproj" fails with: Project "/tmp/foo.csproj" on node 1 (default targets). /usr/lib/mono/msbuild/15.0/bin/Microsoft.CSharp.CurrentVersion.targets(331,5): error MSB4019: The imported project "/usr/lib/mono/msbuild/15.0/bin/Roslyn/Microsoft.CSharp.Core.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. [/tmp/foo.csproj] Done Building Project "/tmp/foo.csproj" (default targets) -- FAILED. Workaround: sudo ln -s /usr/lib/mono/msbuild/Current/bin/Roslyn /usr/lib/mono/msbuild/15.0/bin/Roslyn After applying workaround test project will fail with different error, but that is ok, because project is incomplete. Complete projects build fine. |
This task depends upon
More details here: https://github.com/mono/mono/issues/14875
If its expected to have a symlink from Current to tools version 15, please report this upstream. I think its a related but different issue as mono would be supposed to create that symlink during 'make install' which it currently doesn't do.
The upstream deb runtime seems to have such a symlink, but i can't see where its magically coming from, so an upstream report would be useful as a 'make install' is supposed to create that link if its required.
EDIT: I tried manually compiling Mono 6.4.0, but it had the same problem. Tried both msbuild-16 and msbuild-15. Right now I'm downgrading Mono to try to compile .NET projects.
EDIT2: I got it to work by installing `msbuild` then reinstalling the `mono` package.
The upstream debs also include those symlinks as part of the msbuild packaging (see https://github.com/mono/linux-packaging-msbuild/blob/master/debian/msbuild.links), that's why I'm including them in the msbuild AUR PKGBUILD.
And as far as I know, Debian itself doesn't even have a MSBuild package.
https://aur.archlinux.org/packages/msbuild-git
Those are source-built.
From what I saw, mono bunbles the binary msbuild on it's tarball and debian picks it up. I might be wrong though, I find reading debian package specs and making sense of them unnecessarily hard.
It probably does the same for mono itself but I don't know if it's bundled in the end.
We are going to look into your msbuild AUR packages to try to bring it to the repos. It would also take care of
FS#61769.