Bug 2154 - Saving document with keyboard shortcut results in stacktrace
Summary: Saving document with keyboard shortcut results in stacktrace
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: unspecified
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Mike Krüger
Depends on:
Reported: 2011-11-22 10:51 UTC by Geert Audenaert
Modified: 2015-08-20 03:24 UTC (History)
1 user (show)

Is this bug a regression?: ---
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 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 Geert Audenaert 2011-11-22 10:51:13 UTC
// Triggered by saving document
// with this content:

	public class CallbackApiHttpHandler : IHttpHandler
		private string sikey;
		public void ProcessRequest (HttpContext context)
			HttpRequest request = context.Request;
			HttpResponse response = context.Response;
			// Validate incomming request
			if (request.HttpMethod != "POST") {
				response.StatusCode = 405;
				response.StatusDescription = "Method not allowed";
				response.End ();
			if (request.Headers ["X-Nuntiuz-Service-Key"] != sikey) {
				response.StatusCode = 401;
				response.StatusDescription = "Not authorized";
				response.End ();
			if (request.ContentType != "application/json-rpc") {
				response.StatusCode = 400;
				response.StatusDescription = "Bad request";
				response.End ();

			using (StreamReader sr = new StreamReader(req


System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Cannot cast from source type to destination type.
  at Mono.CSharp.CSharpParser.case_142 () [0x00016] in /private/tmp/source/monodevelop/main/contrib/ICSharpCode.NRefactory/CSharp/Parser/mcs/cs-parser.jay:1263 
  at Mono.CSharp.CSharpParser.yyparse (yyInput yyLex) [0x01768] in /private/tmp/source/monodevelop/main/contrib/ICSharpCode.NRefactory/CSharp/Parser/mcs/cs-parser.jay:1241 
  at Mono.CSharp.CSharpParser.parse () [0x00032] in /private/tmp/source/monodevelop/main/contrib/ICSharpCode.NRefactory/CSharp/Parser/mcs/cs-parser.jay:6548 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000eb] in /private/tmp/monobuild/build/BUILD/mono-2.10.6/mcs/class/corlib/System.Reflection/MonoMethod.cs:234 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.10.6/mcs/class/corlib/System.Reflection/MethodBase.cs:96 
  at MonoDevelop.Components.Commands.CommandHandlerInfo.Run (System.Object cmdTarget, MonoDevelop.Components.Commands.Command cmd) [0x00029] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1386 
  at MonoDevelop.Components.Commands.CommandManager+<DispatchCommand>c__AnonStorey42.<>m__56 () [0x0003d] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:597 
  at MonoDevelop.Components.Commands.CommandManager.DispatchCommand (System.Object commandId, System.Object dataItem, System.Object initialTarget, CommandSource source) [0x0029e] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:614
Comment 1 Mike Krüger 2011-11-24 06:02:12 UTC
Fixed in the new resolver branch.
Some C# errors can cause these crashes in the mcs parser.