This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 41722 - Build Failed
Summary: Build Failed
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General (show other bugs)
Version: 6.0.0 (C7)
Hardware: PC Windows
: High normal
Target Milestone: C7SR1
Assignee: Matt Ward
URL:
: 42149 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-06-10 20:18 UTC by John Male
Modified: 2016-07-05 18:27 UTC (History)
5 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description John Male 2016-06-10 20:18:55 UTC
Description of Problem:

I upgraded to the version 6.0 and changed to the Community from Business Edition since we no longer require the Business license for the development we are performing.

Steps to reproduce the problem:
1. I selected a solution to Clean and Build. This solution worked fine in the older versions of Xamarin
2. The Clean runs fine
3. The Build immediately produces an error


Actual Results: Below is what I find in the Ide.2016-06-10__12-47-21.log file 

Expected Results:
ERROR [2016-06-10 13:06:58Z]: Build failed.
MonoDevelop.Core.UserException: Command execution failed: Object reference not set to an instance of an object.
   at MonoDevelop.Projects.CustomCommand.<Execute>d__38.MoveNext() in C:\Users\builder\data\lanes\3343\694a75f0\source\monodevelop\main\src\core\MonoDevelop.Core\MonoDevelop.Projects\CustomCommand.cs:line 303
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MonoDevelop.Projects.CustomCommandCollection.<ExecuteCommand>d__3.MoveNext() in C:\Users\builder\data\lanes\3343\694a75f0\source\monodevelop\main\src\core\MonoDevelop.Core\MonoDevelop.Projects\CustomCommandCollection.cs:line 61
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MonoDevelop.Projects.SolutionItem.<InternalBuild>d__113.MoveNext() in C:\Users\builder\data\lanes\3343\694a75f0\source\monodevelop\main\src\core\MonoDevelop.Core\MonoDevelop.Projects\SolutionItem.cs:line 623
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MonoDevelop.Projects.SolutionItem.<BuildTask>d__112.MoveNext() in C:\Users\builder\data\lanes\3343\694a75f0\source\monodevelop\main\src\core\MonoDevelop.Core\MonoDevelop.Projects\SolutionItem.cs:line 580
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MonoDevelop.Projects.SolutionFolder.<>c__DisplayClass49_1.<<RunParallelBuildOperation>b__3>d.MoveNext() in C:\Users\builder\data\lanes\3343\694a75f0\source\monodevelop\main\src\core\MonoDevelop.Core\MonoDevelop.Projects\SolutionFolder.cs:line 675
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at MonoDevelop.Projects.SolutionFolder.<RunParallelBuildOperation>d__49.MoveNext() in C:\Users\builder\data\lanes\3343\694a75f0\source\monodevelop\main\src\core\MonoDevelop.Core\MonoDevelop.Projects\SolutionFolder.cs:line 687
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MonoDevelop.Projects.SolutionItem.<BuildTask>d__112.MoveNext() in C:\Users\builder\data\lanes\3343\694a75f0\source\monodevelop\main\src\core\MonoDevelop.Core\MonoDevelop.Projects\SolutionItem.cs:line 603
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MonoDevelop.Ide.ProjectOperations.<BuildSolutionItemAsync>d__102.MoveNext() in C:\Users\builder\data\lanes\3343\694a75f0\source\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide\ProjectOperations.cs:line 1367


How often does this happen? 
Every time I try to perform a Build on the code


Additional Information:
Comment 1 John Male 2016-06-10 20:22:58 UTC
Here is the info from the log file that shows what is happening when the IDE is starting

INFO [2016-06-10 12:47:21Z]: Starting Xamarin Studio 6.0 (build 5174)
INFO [2016-06-10 12:47:21Z]: Running on Microsoft .NET 4.0.30319.42000
INFO [2016-06-10 12:47:21Z]: Operating System: Windows 10.0.10586.0 (64-bit)
INFO [2016-06-10 12:47:21Z]: Found GTK# version 2.12.38
INFO [2016-06-10 12:47:21Z]: Using GTK+ 2.24.26
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.Core
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.Ide
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.WindowsPlatform
INFO [2016-06-10 12:47:21Z]: Initializing Runtime MS.NET
INFO [2016-06-10 12:47:21Z]: Framework .NETCore,Version=v5.0 has unknown RuntimeVersion 5.0
INFO [2016-06-10 12:47:21Z]: GTK: Using Gtk theme from C:\Users\Programer 3\AppData\Roaming\XamarinStudio-6.0\Config\share\themes\Light
INFO [2016-06-10 12:47:21Z]: Framework .NETPortable,Version=v5.0 has unknown RuntimeVersion 5.0
Starting Xamarin Studio
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.UnitTesting
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.RegexToolkit
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.Debugger
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.SourceEditor2
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.DesignerSupport
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.Refactoring
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.FSharpBinding
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.TextTemplating
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.Xml
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.AspNet
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.CSharpBinding
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.PackageManagement
INFO [2016-06-10 12:47:21Z]: Add-in loaded: Xamarin.Ide.Insights
INFO [2016-06-10 12:47:21Z]: Add-in loaded: Xamarin.TestCloud
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.Debugger.Soft
ERROR [2016-06-10 12:47:21Z]: Invalid assembly in framework 'MonoTouch,Version=v1.0': C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoTouch\v1.0\Newtonsoft.Json.dll
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.Xamarin.Ide
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.MonoAndroid
INFO [2016-06-10 12:47:21Z]: Add-in loaded: Xamarin.Forms.Addin
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.VBBinding
INFO [2016-06-10 12:47:21Z]: Add-in loaded: MonoDevelop.VersionControl
   Loading Workbench
INFO [2016-06-10 12:47:22Z]: Add-in loaded: MonoDevelop.AssemblyBrowser
INFO [2016-06-10 12:47:22Z]: Add-in loaded: MonoDevelop.GtkCore
INFO [2016-06-10 12:47:22Z]: Add-in loaded: MonoDevelop.VersionControl.Git
INFO [2016-06-10 12:47:22Z]: Add-in loaded: MonoDevelop.DocFood
INFO [2016-06-10 12:47:22Z]: Add-in loaded: Xamarin.TestCloud.NUnit
INFO [2016-06-10 12:47:22Z]: Add-in loaded: MonoDevelop.WebReferences
INFO [2016-06-10 12:47:22Z]: ANDROID: sdk:   Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidSdkDirectory found:
    Path contains adb.exe in \platform-tools (C:\Users\Programer 3\AppData\Local\Android\android-sdk).
INFO [2016-06-10 12:47:22Z]: ANDROID: sdk:   Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidNdkDirectory found:
    Path contains ndk-stack.exe in \. (C:\Users\Programer 3\Documents\Android\ndk\android-ndk-r10d).
INFO [2016-06-10 12:47:22Z]: ANDROID: sdk:   Key HKCU\SOFTWARE\Novell\Mono for Android\JavaSdkDirectory found:
    Path contains jarsigner.exe in \bin (C:\Program Files (x86)\Java\jdk1.7.0_71).
INFO [2016-06-10 12:47:22Z]: ANDROID: Found Xamarin.Android 6.1.0
INFO [2016-06-10 12:47:22Z]: ANDROID: Found Android SDK. API levels: 15, 16, 17, 18, 19, 21, 22, 23
INFO [2016-06-10 12:47:22Z]: No license found for Android
INFO [2016-06-10 12:47:22Z]: Running license sync for Android
INFO [2016-06-10 12:47:22Z]: Not logged in, using Android Community
      Initializing Main Window
INFO [2016-06-10 12:47:22Z]: Creating DefaultWorkbench
INFO [2016-06-10 12:47:22Z]: Read license: Android Community
INFO [2016-06-10 12:47:22Z]: Updating Welcome Page from 'https://software.xamarin.com/Service/News'.
INFO [2016-06-10 12:47:22Z]: Updating Prebuilt Apps from 'https://xamarin.com/PrebuiltApps.xml'.
INFO [2016-06-10 12:47:23Z]: Add-in loaded: MonoDevelop.VersionControl.Subversion
INFO [2016-06-10 12:47:23Z]: Add-in loaded: MonoDevelop.VersionControl.Subversion.Windows
INFO [2016-06-10 12:47:23Z]: Read license: Android Community
INFO [2016-06-10 12:47:23Z]: Read license: Android Community
INFO [2016-06-10 12:47:23Z]: Add-in loaded: MonoDevelop.Xamarin.Ide.Windows
INFO [2016-06-10 12:47:23Z]: Add-in loaded: MonoDevelop.UnitTesting.NUnit
node `classlib-gecko' is not defined on the documentation map
node `classlib-taglib-sharp' is not defined on the documentation map
node `classlib-webkit' is not defined on the documentation map
INFO [2016-06-10 12:47:23Z]: Welcome Page updated.
INFO [2016-06-10 12:47:23Z]: Prebuilt Apps image already up-to-date.
INFO [2016-06-10 12:47:23Z]: Prebuilt Apps image already up-to-date.
INFO [2016-06-10 12:47:24Z]: Prebuilt Apps image already up-to-date.
INFO [2016-06-10 12:47:24Z]: Prebuilt Apps image already up-to-date.
INFO [2016-06-10 12:47:24Z]: Prebuilt Apps already up-to-date.
INFO [2016-06-10 12:47:24Z]: Prebuilt Apps updated.
INFO [2016-06-10 12:47:24Z]: Prebuilt Apps image already up-to-date.
INFO [2016-06-10 12:47:36Z]: ANDROID: Tracking android devices started
INFO [2016-06-10 12:47:36Z]: ANDROID: Got new device list from adb with 1 devices
INFO [2016-06-10 12:47:38Z]: Add-in loaded: MonoDevelop.Debugger.Win32
ERROR [2016-06-10 12:48:30Z]: Command execution failed
System.NullReferenceException: Object reference not set to an instance of an object.
   at MonoDevelop.Projects.CustomCommand.<Execute>d__38.MoveNext() in C:\Users\builder\data\lanes\3343\694a75f0\source\monodevelop\main\src\core\MonoDevelop.Core\MonoDevelop.Projects\CustomCommand.cs:line 279
Comment 2 Matt Ward 2016-06-16 13:30:41 UTC
I can repro the same null reference exception at line 279 in MonoDevelop.Projects\CustomCommand.cs however I am not doing a Clean and Build but instead running a custom command.

My repro steps are:

1) Create a new C# console project.
2) Open project options and select Build - Custom Commands
3) In the drop down select Custom Command.
  Give the command a name (e.g. TestCommand)
  Enter a command. You can type anything in here - does not matter.
  Make sure Run on external console is checked.
 Click OK.
4) Right click the project and select the custom command just created.

Then nothing happens and in the IDE log is the null reference exception:

ERROR [2016-06-16 14:04:45Z]: Command execution failed
System.NullReferenceException: Object reference not set to an instance of an object
  at MonoDevelop.Projects.CustomCommand+<Execute>c__async0.MoveNext () [0x0016d] in /Users/builder/data/lanes/3342/694a75f0/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommand.cs:279 
ERROR [2016-06-16 14:04:46Z]: An unhandled exception has occured. Terminating Xamarin Studio? False
MonoDevelop.Core.UserException: Command execution failed: Object reference not set to an instance of an object
  at MonoDevelop.Projects.CustomCommand+<Execute>c__async0.MoveNext () [0x0032d] in /Users/builder/data/lanes/3342/694a75f0/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommand.cs:303 


Looking at the bug report another way to reproduce this is:

1) Open project options and select Build - Custom Commands.
2) In the drop down select Before Build, enter a command, check Run on external console. Then click OK to save the changes.
3) Then build the project.
Comment 3 xamarin-release-manager 2016-06-16 13:56:06 UTC
Fixed in version 6.1.0.4747 (master)

Author: Matt Ward
Commit: 611f747203ce646dc3cee4b892260d3c692f9187 (mono/monodevelop)
Comment 4 xamarin-release-manager 2016-06-16 17:34:12 UTC
Fixed in version 6.0.2.15 (cycle7)

Author: Matt Ward
Commit: f80523a1b8c42b37051d1333da00ed0942de3c20 (mono/monodevelop)
Comment 6 Matt Ward 2016-06-24 14:21:03 UTC
*** Bug 42149 has been marked as a duplicate of this bug. ***
Comment 7 abhi 2016-07-05 18:27:14 UTC
I have checked this issue with C7 build :XamarinStudio-6.0.2.41_c92f57f326843c4c6e475a26d627b240ab8580f9 and now this issue working fine. and now I am successfully able to build the console project.

Screencast:http://www.screencast.com/t/0tNxAlRoJOw

Hence I closing this issue.
Thanks!!

Note You need to log in before you can comment on or make changes to this bug.