Bug 1294967

Summary: CSC fails with "SDK path could not be resolved"
Product: [Fedora] Fedora Reporter: Matthias Mailänder <matthias>
Component: monoAssignee: Timotheus Pokorra <pokorra.mailinglists>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 23CC: chkr, claudiorodrigo, itamar, lxtnow, paul, pokorra.mailinglists
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-04 14:13:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Matthias Mailänder 2015-12-31 10:55:35 UTC
Description of problem:
error CS8001: Warning as Error: SDK path could not be resolved

Version-Release number of selected component (if applicable):
mono-devel-4.0.5-1.fc23.x86_64

How reproducible:
always

Steps to Reproduce:
https://github.com/OpenRA/OpenRA/wiki/Compiling

Actual results:
error CS8001: Warning as Error: SDK path could not be resolved

Additional info:
https://build.opensuse.org/package/show/games:openra/release

Comment 1 Matthias Mailänder 2015-12-31 11:01:43 UTC
See https://github.com/OpenRA/OpenRA/issues/10248 for the downstream bug.

Comment 2 Timotheus Pokorra 2016-01-02 19:32:48 UTC
It seems that dmcs should be deprecated.

easy solution:

change in your Makefile for OpenRA:

CSC         = mcs

then make core works for me.

It seems that dmcs targets the 4.0 sdk, which is not delivered with Fedora 23 anymore. The 4.0 sdk is only available as binaries in the Mono 4.x tarball, and we cannot build the files 4.0 sdk from source.
So we are only providing the 4.5 sdk.

So we could probably dump the /usr/bin/dmcs because it is not useful anymore at all.

Comment 3 Matthias Mailänder 2016-01-03 20:58:19 UTC
Have you reported that the 4.0 SDK sources are missing in the tarball and/or is this already fixed in Mono 4.2.1?

Comment 4 Timotheus Pokorra 2016-01-04 07:04:15 UTC
As far as I understand, the support for .Net 2.0 was dropped: http://lists.ximian.com/pipermail/mono-devel-list/2014-October/042145.html
This somehow also affected all versions up to and including .Net 4.0, and only .Net 4.5 is supported in the release branches.
I guess the reason was that the code is now much cleaner, and only one .Net SDK needs to be supported by the Mono team.

Also reading http://www.mono-project.com/docs/about-mono/languages/csharp/
"Starting with Mono version 2.11 a new unified compiler mcs is available. It replaces all previous runtime specific compilers (gmcs, dmcs, smcs). They still exist (as scripts only) to ease the migration path to mcs but we strongly recommend to use mcs."

It seems to me that the best way is to use the latest .Net framework, ie. 4.5.
For Fedora 23, when we upgraded to Mono4, we replaced all occurences of TargetFramework in the csproj files with 4.5:

eg. for MonoDevelop: in http://pkgs.fedoraproject.org/cgit/monodevelop.git/tree/monodevelop.spec#n78

you find these lines:

#Fixes for Mono 4
sed -i "s#gmcs#mcs#g" configure
sed -i "s#gmcs#mcs#g" configure.in
sed -i "s#mono-nunit#nunit#g" configure.in
find . -name "*.sln" -print -exec sed -i 's/Format Version 10.00/Format Version 11.00/g' {} \;
find . -name "*.csproj" -print -exec sed -i 's#ToolsVersion="3.5"#ToolsVersion="4.0"#g; s#<TargetFrameworkVersion>.*</TargetFrameworkVersion>##g; s#<PropertyGroup>#<PropertyGroup><TargetFrameworkVersion>v4.5</TargetFrameworkVersion>#g' {} \;

Comment 5 Timotheus Pokorra 2016-01-04 14:13:05 UTC
I have now removed dmcs from Mono in Rawhide to avoid confusion:

http://pkgs.fedoraproject.org/cgit/mono.git/commit/?id=6089cadb648a2203daee01484c1c92104b66d9a0