Bug 41790 - Xamarin Studio fatal error when running project build custom commands
Summary: Xamarin Studio fatal error when running project build custom commands
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Project Management (show other bugs)
Version: 6.0.0 (C7)
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: C7SR0
Assignee: Matt Ward
Depends on:
Reported: 2016-06-14 09:56 UTC by Alberto Pastore
Modified: 2016-07-13 17:11 UTC (History)
4 users (show)

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

IDE Logs containing the unhandled exception occurring (11.95 KB, text/plain)
2016-06-14 13:11 UTC, Alberto Pastore

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 Developer Community or GitHub 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:

Description Alberto Pastore 2016-06-14 09:56:54 UTC
I have several c# console projects with custom build commands (basically they are all external bash scripts run within the project's directory).

Every time I launch such commands, Xamarin Studio pops up a fatal error dialog and then shuts down.

I've tried also running script with the "external console" flag checked but the problem persists.

This behavior began after upgrading to version 6 (no problems with 5.x).
Comment 1 Matt Ward 2016-06-14 12:09:14 UTC
Can you attach the IDE logs? They can be found by selecting Help - Open Log Directory. Thanks.
Comment 2 Alberto Pastore 2016-06-14 13:11:30 UTC
Created attachment 16315 [details]
IDE Logs containing the unhandled exception occurring
Comment 3 Alberto Pastore 2016-06-14 13:33:42 UTC
FYI, this is the portion of the csproj file containing the custom command whose execution triggers the fault:

    <Command type="Custom" name="Deploy" command="/bin/bash ${ProjectDir}/Scripts/deploy" workingdir="${ProjectDir}" />
Comment 4 xamarin-release-manager 2016-06-17 10:42:47 UTC
Fixed in version (master)

Author: Matt Ward
Commit: 12daf1b4216f9d5c2c4c8813d13f33f704f5f9a1 (mono/monodevelop)
Comment 5 xamarin-release-manager 2016-06-17 11:06:03 UTC
Fixed in version (cycle7)

Author: Matt Ward
Commit: 99cda42224ed1e7d8ad4f3bce26371129401db9b (mono/monodevelop)
Comment 6 Matt Ward 2016-06-17 12:12:25 UTC
Steps to repro:

1) Create a new C# console project.
2) Open project options then go to Build - Custom Commands.
3) In the Select a project operation drop down select Custom Command.
4) Enter a name (e.g. TestCommand), a command (e.g. mono path/to/some/executable.exe) and click OK.
5) Right click the project in the Solution window and select the custom command just created from the menu.

Expected result:

Custom command is run. Output is available in the Application Output window.

Actual result:

Xamarin Studio reports a fatal error and then terminates.
Note that if the command runs fast enough then Xamarin Studio may not crash. It should crash if you keep retrying the command enough times. When running something like 'mono --version' it sometimes works without crashing. Running a separate .exe it should crash the first time.
Comment 7 xamarin-release-manager 2016-06-20 17:10:40 UTC
Fixed in version (cycle7-sr0)

Author: Matt Ward
Commit: aa14882c177ad9339a73846fc934912e1da4530d (mono/monodevelop)
Comment 8 Kyle White 2016-06-20 17:38:06 UTC
I have verified this issue in C7SR0 build and issue is resolved. 

Full build information https://gist.github.com/kdubau/9ff0da77465a5f1b3b626c8fd7572f61