Bug 5092 - Cannot run program - method too complex
Summary: Cannot run program - method too complex
Alias: None
Product: Runtime
Classification: Mono
Component: Interop ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2012-05-15 12:18 UTC by hramrach
Modified: 2017-07-11 23:07 UTC (History)
4 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 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:

Description hramrach 2012-05-15 12:18:16 UTC
I tried to run a .NET program from 



Unhandled Exception: System.InvalidOperationException: WinForms_SeeInnerException ---> System.InvalidProgramException: Method
SR4CG.Form1:InitializeComponent () is too complex.

It WorsOnWindows(TM)
Comment 1 hramrach 2012-05-15 12:23:35 UTC
Mono JIT compiler version (Debian
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	LLVM:          supported, not enabled.
	GC:            Included Boehm (with typed GC and Parallel Mark)
Comment 2 bluedzins 2015-06-09 14:09:04 UTC
openSUSE 13.2, mono 4.0.1, I still see this bug. After googling it seems it has something go heavy methods, in my case it is around of 30K _lines_ of code (around 10K statements).

It is possible to run the program applying "-O=-inline" option.

On Windows the same program runs without any problem.
Comment 3 bluedzins 2015-07-12 15:30:09 UTC
Update: "inline" hack was good when it worked, not anymore. I have constructor (auto-generated) with around 34K lines now, and even with "inline" option mono refuses to run the program "constructor is too complex".

Comment 4 Rodrigo Kumpera 2017-07-11 23:07:12 UTC
We no longer have that restriction.