Bug 51194 - [Master] Getting build error on building console application.
Summary: [Master] Getting build error on building console application.
Status: RESOLVED DUPLICATE of bug 50710
Alias: None
Product: Tools
Classification: Mono
Component: xbuild ()
Version: unspecified
Hardware: PC Mac OS
: High major
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
Depends on:
Reported: 2017-01-03 16:18 UTC by Parmendra Kumar
Modified: 2017-02-03 22:54 UTC (History)
7 users (show)

Is this bug a regression?: Yes
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Comment 1 Sebastien Pouliot 2017-01-03 16:37:27 UTC
@Parmendra If it's a build error then you *need* to include the full build log.
Comment 2 Parmendra Kumar 2017-01-03 16:46:08 UTC
Please have a look debuglog:

BuildLog: https://gist.github.com/Parmendrak/b1eafc9a29d9f1ccc8ca598daccd08d1

Comment 3 Alex Soto [MSFT] 2017-01-03 17:20:46 UTC
@Parmendra any chance you could give us a diagnostic build log? You can enable it by following these steps https://developer.xamarin.com/guides/android/troubleshooting/troubleshooting/#Diagnostic_MSBuild_Output
Comment 4 Sebastien Pouliot 2017-01-03 20:42:21 UTC
	Target CoreCompile:
		Tool /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/smcs execution started with arguments: /noconfig /debug:portable /debug:portable /optimize- /out:obj/iPhoneSimulator/Debug/SingleViewMaster.exe Main.cs AppDelegate.cs ViewController.cs ViewController.designer.cs obj/iPhoneSimulator/Debug/Xamarin.iOS,Version=v1.0.AssemblyAttribute.cs /target:exe /define:"__UNIFIED__;__MOBILE__;__IOS__;DEBUG;ENABLE_TEST_CLOUD" /nostdlib /platform:x86 /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.dll /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Xml.dll /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Core.dll /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Xamarin.iOS.dll /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS//mscorlib.dll /warn:4
CSC: error CS1902: Invalid debug option `portable'. Valid options are `full' or `pdbonly'
CSC: error CS1902: Invalid debug option `portable'. Valid options are `full' or `pdbonly'
	Task "Csc" execution -- FAILED

This sounds like a mismatch between `mcs` and the msbuild csc task.

@Jeff the `Csc` task comes from mono right ?

note: the argument is also specified twice: `/debug:portable /debug:portable`
Comment 5 Parmendra Kumar 2017-01-04 16:39:48 UTC
Please have a look diagnostic build log.

BuildLog: https://gist.github.com/Parmendrak/76d76bf300625fa96173e12bd3013234
Comment 6 Jeffrey Stedfast 2017-01-04 21:42:08 UTC
Correct. The Csc task is from xbuild/Mono.
Comment 7 Jeffrey Stedfast 2017-01-04 22:22:27 UTC
Are you using msbuild instead of xbuild?
Comment 8 Jeffrey Stedfast 2017-01-04 22:28:30 UTC
I was going to suggest that we could add logic to Xamarin.iOS.Common.props to force DebugType to be 'full' or 'pdbonly', but according to the logs, your DebugType is set to 'full' already.

So somehow the Csc task is overriding that value and using 'portable' instead.

This is out of the iOS MSBuild code's area of influence.
Comment 9 Alex Soto [MSFT] 2017-01-05 04:25:55 UTC
> Are you using msbuild instead of xbuild?
Comment 10 Parmendra Kumar 2017-01-05 16:49:02 UTC
@Alex, Yes I am using MSBuild instead of xbuild

Screencast: https://www.screencast.com/t/3aJ9xwZSsT3

Comment 11 Jeffrey Stedfast 2017-01-05 17:18:42 UTC
Okay, now that we know that this only happens when using MSBuild instead of XBuild... perhaps Ankit has some ideas?
Comment 12 Alex Soto [MSFT] 2017-01-06 05:40:08 UTC
Hello @Parmendra I tried to reproduce this using Xcode 8.2.1 + Xamarin.iOS (master @ 1852ff7) + Mono (master @ 286ddeb) + msbuild in XS and it builds just fine here. 

Could you try a newer mono?
Comment 13 Parmendra Kumar 2017-01-06 11:09:49 UTC
@Alex, I have checked this issue with latest Master build and I am still getting same issue.



EnvironmentInfo: https://gist.github.com/Parmendrak/01e242ce15372d97b207c47fed3ba441

BuildOutput: https://gist.github.com/Parmendrak/01e242ce15372d97b207c47fed3ba441
Comment 14 Sebastien Pouliot 2017-01-09 21:04:33 UTC
/Library/Frameworks/Mono.framework/Versions/4.9.0/lib/mono/msbuild/15.0/bin//Microsoft.CSharp.Core.targets(67,5): error MSB4036: The "Csc" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "/Library/Frameworks/Mono.framework/Versions/4.9.0/lib/mono/msbuild/15.0/bin" directory.

@Parmendra your latest log does not show the original issue ^ and that's also something that seems entirely within mono

Are you able to build "normal" (e.g. console) application ?
Comment 16 Sebastien Pouliot 2017-01-10 19:16:22 UTC
If it happens for a console app then it removes all the pieces from XI.

-> Mono
Comment 17 Ankit Jain 2017-02-03 22:54:15 UTC

*** This bug has been marked as a duplicate of bug 50710 ***