Bug 8480 - Go to declaration on base class threw InvalidProgramException
Summary: Go to declaration on base class threw InvalidProgramException
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: Trunk
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2012-11-17 20:53 UTC by Andres G. Aragoneses
Modified: 2013-09-04 07:11 UTC (History)
3 users (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 Andres G. Aragoneses 2012-11-17 20:53:23 UTC
This is how I reproduced it:
1. Run monodevelop master branch.
2. Open monodevelop solution inside monodevelop.
3. Go to DebugValueWindow.cs, line 67, right click in "BaseWindow"
4. Click on "Go to declaration".

Current results:
Boom: Error while executing command: Refactory Operations. 
Details: System.InvalidProgramException: Missing or incorrect header for method cumentChanged
  at MonoDevelop.Ide.Gui.Workbench.OpenDocument (FilePath fileName, Int32 line, Int32 column, OpenDocumentOptions options, System.Text.Encoding encoding, IViewDisplayBinding binding) [0x000fa] in /home/andres1210/Code/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:379 
  at MonoDevelop.Ide.Gui.Workbench.OpenDocument (FilePath fileName, Int32 line, Int32 column, OpenDocumentOptions options) [0x00000] in /home/andres1210/Code/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:346 
  at MonoDevelop.Ide.ProjectOperations.JumpToDeclaration (INamedElement element) [0x0009f] in /home/andres1210/Code/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs:278 
  at MonoDevelop.Ide.ProjectOperations.JumpToDeclaration (INamedElement visitable, Boolean askIfMultipleLocations) [0x0009f] in /home/andres1210/Code/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs:258 
  at MonoDevelop.Refactoring.CurrentRefactoryOperationsHandler+JumpTo.Run () [0x0008e] in /home/andres1210/Code/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs:129 
  at MonoDevelop.Refactoring.CurrentRefactoryOperationsHandler.Run (System.Object data) [0x0000d] in /home/andres1210/Code/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs:80 
  at MonoDevelop.Components.Commands.CommandHandler.InternalRun (System.Object dataItem) [0x00000] in /home/andres1210/Code/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandHandler.cs:42 
  at MonoDevelop.Components.Commands.CommandManager.DefaultDispatchCommand (MonoDevelop.Components.Commands.ActionCommand cmd, MonoDevelop.Components.Commands.CommandInfo info, System.Object dataItem, System.Object target, CommandSource source) [0x00064] in /home/andres1210/Code/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1096 
  at MonoDevelop.Components.Commands.CommandManager.DispatchCommand (System.Object commandId, System.Object dataItem, System.Object initialTarget, CommandSource source) [0x002d1] in /home/andres1210/Code/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1067
Comment 1 Mike Krüger 2012-11-27 01:58:39 UTC
Are you using mono master to compile monodevelop ?

InvalidProgramException says something like: .NET assembly corrupt.

(I can't reproduce this one with md master btw.)
Comment 2 Andres G. Aragoneses 2012-11-27 07:26:41 UTC
> Are you using mono master to compile monodevelop ?

No. Using standard Mono of Ubuntu (2.10.x)

> (I can't reproduce this one with md master btw.)

I just pulled the latest master and I cannot reproduce it either anymore! Weird. Well, I'll mark this as resolved then. Thanks!
Comment 3 Stephen Shaw 2013-06-28 14:55:50 UTC
We just ran into this today on the beta channel.

14:55 < sshaw> we have a struct with 4 things in it. one of them is 'public Object data'
14:57 < sshaw> we set it to (List<MyObject>). In this case we didn't have a using statement and it was ambiguous as to which MyObject
               it was
14:57 < sshaw> it still compiled
14:58 < sshaw> windows caught the error, mono didn't
14:59 < sshaw> this is the error that msbuild generated that XS didn't
14:59 < sshaw> https://gist.github.com/decriptor/eb737d6a568a47138044

15:05 < sshaw> kumpera: looking at it, I think we were passing in the struct with one type of data

ie, NameSpace1.Report

15:05 < sshaw> and then in this line
15:05 < sshaw>     var rptList = (List<Report>)response.data;
15:05 < sshaw> trying to pull the data out
15:06 < sshaw> where <Report> could have been any 1 of 3 different things

=== Xamarin Studio ===

Version 4.0.9 (build 12)
Installation UUID: da02389f-4d61-4cfd-bf57-ee521389a5dc
	Mono 3.0.12 ((no/d6c5db8)
	GTK 2.24.18
	GTK# (
	Package version: 300120000

=== Apple Developer Tools ===

Xcode 4.6.3 (2068)
Build 4H1503

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: fa63be7
Build date: 2013-17-06 20:54:24-0400

=== Xamarin.Android ===

Version: 4.7.9 (Business Edition)
Android SDK: /Users/sgshaw/android-sdks
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
Java SDK: /usr
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-456-11M4508)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-456, mixed mode)

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Build Information ===

Release ID: 400090012
Git revision: f9c5c24e88417feb0319953db6d5fc650d416608
Build date: 2013-06-21 17:34:16+0000
Xamarin addins: 898d8afaabb160c025e21656f1490fa149397bff

=== Operating System ===

Mac OS X 10.8.4
Darwin sgshaw_pro 12.4.0 Darwin Kernel Version 12.4.0
    Wed May  1 17:57:12 PDT 2013
    root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64
Comment 4 Rodrigo Kumpera 2013-06-28 16:31:11 UTC
Reopening as per the above comment.
Comment 5 Mike Krüger 2013-07-02 02:24:36 UTC
InvalidProgramException is still a compiler error :/
Comment 6 Mike Krüger 2013-07-02 02:25:33 UTC
And I don't see what the comment has to do with the original report - maybe the wrong bug ?
Comment 7 Mike Krüger 2013-09-04 07:11:35 UTC
works for me - InvalidProgramException isn't something we could fix at all (must've been an unlucky mcs version)