Bug 19097 - Aspect Oriented Programming condition param_count not met
Summary: Aspect Oriented Programming condition param_count not met
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: unspecified
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-04-16 17:41 UTC by John Miller [MSFT]
Modified: 2014-09-23 08:26 UTC (History)
8 users (show)

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


Attachments
Repro Project (1.53 MB, application/zip)
2014-04-16 17:41 UTC, John Miller [MSFT]
Details
Update Repro Project (25.32 KB, application/zip)
2014-04-18 11:24 UTC, John Miller [MSFT]
Details


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:
Status:
RESOLVED FIXED

Description John Miller [MSFT] 2014-04-16 17:41:17 UTC
Created attachment 6599 [details]
Repro Project

# Steps to reproduce

* Run the attached sample project

# Results

[] * Assertion at /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/0deb0164/source/mono/mono/metadata/loader.c:1110, condition `param_count' not met
[mono-rt] Stacktrace:
[mono-rt] 
[mono-rt]   at <unknown> <0xffffffff>
[mono-rt]   at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) <IL 0x00030, 0xffffffff>
[mono-rt]   at System.Reflection.MonoCMethod.InternalInvoke (object,object[]) <IL 0x00007, 0x00097>
[mono-rt]   at System.Reflection.MonoCMethod.DoInvoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <IL 0x00099, 0x003b3>
[mono-rt]   at System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <IL 0x00007, 0x00087>
[mono-rt]   at System.Reflection.ConstructorInfo.Invoke (object[]) <IL 0x00015, 0x000db>
[mono-rt]   at Catel.IoC.TypeFactory.TryCreateToConstruct (System.Type,System.Reflection.ConstructorInfo,object[],bool,bool) [0x0009e] in c:\Source\Catel\src\Catel.Core\Catel.Core.NET40\IoC\TypeFactory.cs:629
[mono-rt]   at Catel.IoC.TypeFactory.CreateInstanceWithSpecifiedParameters (System.Type,object[],bool,bool,bool) [0x001bb] in c:\Source\Catel\src\Catel.Core\Catel.Core.NET40\IoC\TypeFactory.cs:385
[mono-rt]   at Catel.IoC.TypeFactory.CreateInstance (System.Type) [0x00001] in c:\Source\Catel\src\Catel.Core\Catel.Core.NET40\IoC\TypeFactory.cs:143
[mono-rt]   at Catel.MVVM.ViewModelFactory.CreateViewModel (System.Type,object) [0x00087] in c:\Source\Catel\src\Catel.MVVM\Catel.MVVM.NET40\MVVM\ViewModels\ViewModelFactory.cs:103
[mono-rt]   at Catel.MVVM.Providers.LogicBase.ConstructViewModelUsingArgumentOrDefaultConstructor (object,System.Type) [0x0022f] in c:\Source\Catel\src\Catel.MVVM\Catel.MVVM.NET40\MVVM\Providers\LogicBase.cs:939
[mono-rt]   at Catel.MVVM.Providers.LogicBase.ConstructViewModelUsingArgumentOrDefaultConstructor (object) [0x00001] in c:\Source\Catel\src\Catel.MVVM\Catel.MVVM.NET40\MVVM\Providers\LogicBase.cs:865
[mono-rt]   at Catel.MVVM.Providers.LogicBase.CreateViewModelByUsingDataContextOrConstructor () [0x00038] in c:\Source\Catel\src\Catel.MVVM\Catel.MVVM.NET40\MVVM\Providers\LogicBase.cs:498
[mono-rt]   at Catel.MVVM.Providers.LogicBase.OnTargetViewLoaded (object,System.EventArgs) [0x00012] in c:\Source\Catel\src\Catel.MVVM\Catel.MVVM.NET40\MVVM\Providers\LogicBase.cs:609
[mono-rt]   at Catel.MVVM.Providers.NavigationLogicBase`1.OnTargetViewLoaded (object,System.EventArgs) [0x00001] in c:\Source\Catel\src\Catel.MVVM\Catel.MVVM.NET40\MVVM\Providers\NavigationLogicBase.cs:107
[mono-rt]   at Catel.MVVM.Providers.PhonePageLogic.OnTargetViewLoaded (object,System.EventArgs) [0x00001] in c:\Source\Catel\src\Catel.MVVM\Catel.MVVM.NET40\MVVM\Providers\PhonePageLogic.cs:165
[mono-rt]   at Catel.MVVM.Providers.LogicBase.OnTargetViewLoadedInternal (object,System.EventArgs) [0x00090] in c:\Source\Catel\src\Catel.MVVM\Catel.MVVM.NET40\MVVM\Providers\LogicBase.cs:558
[mono-rt]   at Catel.MVVM.Providers.LogicBase.<.ctor>b__0 () [0x00000] in c:\Source\Catel\src\Catel.MVVM\Catel.MVVM.NET40\MVVM\Providers\LogicBase.cs:193
[mono-rt]   at Catel.MVVM.Views.ViewLoadedManager.HandleViewLoaded (Catel.MVVM.Views.IView) [0x0006d] in c:\Source\Catel\src\Catel.MVVM\Catel.MVVM.NET40\MVVM\Views\ViewLoadedManager.cs:195
[mono-rt]   at Catel.MVVM.Views.ViewLoadedManager.OnViewLoaded (object,System.EventArgs) [0x0002f] in c:\Source\Catel\src\Catel.MVVM\Catel.MVVM.NET40\MVVM\Views\ViewLoadedManager.cs:159
[mono-rt]   at Catel.MVVM.Views.WeakViewInfo.OnLoaded (object,System.EventArgs) [0x00029] in c:\Source\Catel\src\Catel.MVVM\Catel.MVVM.NET40\MVVM\Views\WeakViewInfo.cs:113
[mono-rt]   at (wrapper delegate-invoke) <Module>.invoke_void__this___WeakViewInfo_object_EventArgs (Catel.MVVM.Views.WeakViewInfo,object,System.EventArgs) <IL 0x0005b, 0xffffffff>
[mono-rt]   at Catel.WeakEventListener`3.OnEvent (object,TEventArgs) [0x00043] in c:\Source\Catel\src\Catel.Core\Catel.Core.NET40\WeakReferences\WeakEventListener.cs:600
[mono-rt]   at (wrapper delegate-invoke) System.EventHandler`1.invoke_void__this___object_TEventArgs (object,TEventArgs) <IL 0x00059, 0xffffffff>
[mono-rt]   at Catel.EventHandlerExtensions.SafeInvoke<TEventArgs> (System.EventHandler`1<TEventArgs>,object,TEventArgs) [0x0000a] in c:\Source\Catel\src\Catel.Core\Catel.Core.NET40\EventHandlerExtensions.cs:139
[mono-rt]   at Catel.EventHandlerExtensions.SafeInvoke (System.EventHandler`1<System.EventArgs>,object) [0x00001] in c:\Source\Catel\src\Catel.Core\Catel.Core.NET40\EventHandlerExtensions.cs:71
[mono-rt]   at Catel.Android.App.Activity.OnResume () [0x0000f] in c:\Source\Catel\src\Catel.MVVM\Catel.MVVM.Xamarin.Android\Android\App\Activity.cs:328
[mono-rt]   at Android.App.Activity.n_OnResume (intptr,intptr) [0x00009] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/0deb0164/source/monodroid/src/Mono.Android/platforms/android-14/src/generated/Android.App.Activity.cs:3094
[mono-rt]   at (wrapper dynamic-method) object.97eed1dd-1d19-492c-ae49-49adc38130c5 (intptr,intptr) <IL 0x00011, 0x0003b>
[mono-rt]   at (wrapper native-to-managed) object.97eed1dd-1d19-492c-ae49-49adc38130c5 (intptr,intptr) <IL 0x00022, 0xffffffff>
Comment 2 Jonathan Pryor 2014-04-17 14:43:07 UTC
Would it be possible to get a copy of the Catel source code?

I found http://catel.codeplex.com, but the stack trace doesn't make any sense, e.g. it mentions Catel.IoC.TypeFactory.TryCreateToConstruct(), which I can't find in:

http://catel.codeplex.com/SourceControl/latest#src/Catel.Core/Catel.Core.NET40/IoC/TypeFactory.cs

Why? Because I'd like to know what type it's trying to construct which is causing it to fail.

Alternatively, a smaller test case which doesn't rely upon Catel would be appreciated. ;-)
Comment 3 John Miller [MSFT] 2014-04-17 16:07:37 UTC
@Comment

Response from the customer to your inquiry:

It is trying to create the view model. You can see that in the console because I should have enabled LogManager.AddDebugListener(); Then you get all the detailed logging in the console output.

Note that this is because of AOP. I have also commented on the code so you can disable the AOP (and use actual property definition that does work). Note that the latest source is available here:

https://github.com/catel/catel

Note that if you update to the latest prerelease, the pdb files now have a source link (thus you can step through that code as well).

Providing a custom implementation without Catel is hard because then I have to rewrite a property definition system + fody weaver to provide the AOP.

If you need more information on how to reproduce this issue, just let me know!
Comment 4 Sadik Ali 2014-04-18 02:11:04 UTC
I have test this issue and able to reproduce it. I download the attached project and run it on Emulator.

Supplement Info : https://gist.github.com/Sadik1/dd6bc9c68781eb49696d
Environment Info :
=== Xamarin Studio ===

Version 4.2.3 (build 60)
Installation UUID: ce3f5199-e126-42fd-bc8a-6a96370af9ab
Runtime:
	Mono 3.2.6 ((no/9b58377)
	GTK+ 2.24.23 theme: Raleigh
	GTK# (2.12.0.0)
	Package version: 302060000

=== Apple Developer Tools ===

Xcode 5.1 (5084)
Build 5B130a

=== Xamarin.iOS ===

Version: 7.2.0.2 (Trial Edition)
Hash: 58c3efa
Branch: 
Build date: 2014-10-03 18:02:26-0400

=== Xamarin.Android ===

Version: 4.12.1 (Trial Edition)
Android SDK: /Users/mac109/Desktop/android-sdk-macosx
	Supported Android versions:
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Build Information ===

Release ID: 402030060
Git revision: 30c4afc300c2a39ec5300851357ce02e49dd217e
Build date: 2014-03-05 22:09:33+0000
Xamarin addins: f8a9589b57c2bfab2ccd73c880e7ad81e3ecf044

=== Operating System ===

Mac OS X 10.9.2
Darwin mac109s-Mac-mini.local 13.1.0 Darwin Kernel Version 13.1.0
    Thu Jan 16 19:40:37 PST 2014
    root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64
Comment 5 John Miller [MSFT] 2014-04-18 11:15:19 UTC
Customer Response:

I have been investigating this more. The IL generated by AOP is *exactly* the same. Below are the comparisons on IL level. The code is generated in the static constructor of both models.

Int property without AOP:

L_0044: ldstr "IntProperty"
L_0049: ldtoken int32
L_004e: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
L_0053: ldnull
L_0054: ldnull
L_0055: ldc.i4.1
L_0056: ldc.i4.1
L_0057: ldc.i4.1
L_0058: call class [Catel.Core]Catel.Data.PropertyData [Catel.Core]Catel.Data.ModelBase::RegisterProperty(string, class [mscorlib]System.Type, class [mscorlib]System.Func`1<object>, class [mscorlib]System.EventHandler`1<class [Catel.Core]Catel.Data.AdvancedPropertyChangedEventArgs>, bool, bool, bool)
L_005d: stsfld class [Catel.Core]Catel.Data.PropertyData AopIssue.Models.ModelWithoutAop::IntPropertyProperty

Int property with AOP

L_0044: ldstr "IntProperty"
L_0049: ldtoken int32
L_004e: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
L_0053: ldnull
L_0054: ldnull
L_0055: ldc.i4.1
L_0056: ldc.i4.1
L_0057: ldc.i4.1
L_0058: call class [Catel.Core]Catel.Data.PropertyData [Catel.Core]Catel.Data.ModelBase::RegisterProperty(string, class [mscorlib]System.Type, class [mscorlib]System.Func`1<object>, class [mscorlib]System.EventHandler`1<class [Catel.Core]Catel.Data.AdvancedPropertyChangedEventArgs>, bool, bool, bool)
L_005d: stsfld class [Catel.Core]Catel.Data.PropertyData AopIssue.Models.ModelWithAop::IntPropertyProperty

As you can see, even the addresses are equal.

I have updated the example (see attachment)
Comment 6 John Miller [MSFT] 2014-04-18 11:24:07 UTC
Created attachment 6610 [details]
Update Repro Project
Comment 7 Jonathan Pryor 2014-04-18 11:35:26 UTC
I'm not sure why you're mentioning IntProperty. Regardless...

Your attempt to call LogManager.AddDebugListener() is running afoul of Bug #18350, meaning that it isn to in fact being called.

You can fix this by moving the LogManager.AddDebugListener() call to an overriding Application.OnCreate() method:

https://gist.github.com/jonpryor/c625a0e4c6a3f2b45bf0

With that change in place, `adb logcat` contains additional logging, ending with:

> I/mono-stdout( 2626): 04:44:39:506 => [DEBUG] [Catel.IoC.ServiceLocator] Registered type 'Catel.Services.INavigationService' to instance of type 'Catel.Services.NavigationService'
> I/mono-stdout( 2626): 04:44:39:507 => [DEBUG] [Catel.IoC.TypeFactory] Calling constructor.Invoke with the right parameters

which is:

https://github.com/Catel/Catel/blob/master/src/Catel.Core/Catel.Core.NET40/IoC/TypeFactory.cs#L664

What I don't know, and would like to know, is what `constructor.DeclaringType` is, what the constructor signature is, and what the contents of `finalParamersArray` is.

At which point I enter a world of yack shaving, because the Catel project won't Just Build on OS X, and I need to rebuild my Windows box, and OMG MAKE THE HURTING STOP!
Comment 8 Jonathan Pryor 2014-04-18 13:05:46 UTC
Wanted: A Catel build with this patch applied: https://gist.github.com/jonpryor/97a0f6b59c59ac6b6001
Comment 9 Jonathan Pryor 2014-04-18 15:45:19 UTC
I've finished my initial yak shaving, have a Windows 8.1 + VS 2012 + Xamarin build environment, and...

Catel doesn't build.

Granted, it has a bazillion projects, and generates dozens of warnings when importing into VS2012 that the project isn't supported (_dozens_!, though many make sense such as the Windows 8 projects...)...

But if I build _just_ the Catel.Core.Xamarin.Android.csproj project, it still fails:

  MSBUILD : error : Fody: You don't seem to have configured any weavers. Try adding a Fody nuget package to your project. Have a look here http://nuget.org/packages?q=fody for the list of available packages. [Y:\jon\Downloads\bxc-19097\Catel\src\Catel.Core\Catel.Core.Xamarin.Android\Catel.Core.Xamarin.Android.csproj]

I have no idea how to fix that.
Comment 10 Geert van Horrik 2014-04-19 06:36:21 UTC
Hello Jonathan,

I am very sorry for the inconvenience caused by this repro. I know that Catel contains a lot of projects, but this is to support multiple platforms and extensions that Catel provides. I know I cannot ask you to build Catel simply to reproduce this case.

I have created a new repro (see the attached updated repro uploaded by John) and would like to ask you to try that because it really minimizes the requirement of knowledge about Catel. 

In the issue you are trying to debug the TypeFactory, but that is out of scope for this issue. The updated example I sent you contains 2 models with and without AOP, no need to build Catel from the ground up. You can see that even with direct construction (using new()), the issue arises. It doesn't use the TypeFactory whatsoever.

Below is the code of Activity1:

-----

Log.Info("Creating model without AOP with new()");

var modelWithoutAop = new ModelWithoutAop();

Log.Info("Creating model with AOP with new()");

var modelWithAop = new ModelWithAop(); <---- this line breaks

-----

As you can see, the resulting IL code for both models (look at the static ctor) is exactly the same (except for the class name of course). Calling the first constructor works, calling the second fails.

If you have issues running this example, please let me know and I will be happy to help you out.
Comment 11 Jonathan Pryor 2014-04-21 16:02:53 UTC
The problem is that the IL for ModelWithAop..cctor() is invalid.

How invalid? So invalid that it causes monodis to abort:

    $ MONO_PATH=... monodis AopIssue.dll > AopIssue.il
    Abort trap: 6

The IL for ModelWithAop..cctor():

    // method line 14
    .method private static hidebysig specialname rtspecialname 
           default void '.cctor' ()  cil managed 
    {
    ...
	IL_0058:  call * Assertion at loader.c:1109, condition `param_count' not met

Not coincidentally, that's the same assert message reported in Comment #0.

So what's going on? Moving to the .NET SDK, peverify doesn't like AopIssue.dll:

> >peverify /nologo AopIssue.dll
> [MD]: Error: MethodSpec signature has arity 0 at byte=0x00000002. [token:0x2B000004]
> [MD]: Error: MethodSpec method is not generic. [token:0x2B000004]
> 2 Error(s) Verifying AopIssue.dll

The two [MD] errors have the same cause. Moving on to ILDASM.EXE with all the options enabled:

> // Unresolved Externals
> // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> // ===========================================================
> // Error: MethodSpec signature has arity 0 at byte=0x00000002. [token:0x2B000004] [hr:0x80131B44]
> // Error: MethodSpec method is not generic. [token:0x2B000004] [hr:0x80131B39]
> // Errors found.
> // ===========================================================

Same errors, different syntax. However, this time we have a token ID: 2B000004. Where does that show up?

It shows up in the ModelWithAop..cctor() method (of course!):

> .method /*0600000E*/ private hidebysig specialname rtspecialname static 
>         void  .cctor() cil managed
> // SIG: 00 00 01
> {
>   ...
>   IL_0057:  /* 17   |                  */ ldc.i4.1
>   IL_0058:  /* 28   | (2B)000004       */ call       class [Catel.Core/*23000001*/]Catel.Data.PropertyData/*0100000E*/ [Catel.Core/*23000001*/]Catel.Data.ModelBase/*0100000D*/::RegisterProperty<>(string,
>                                                                                                                                                                                                     class [mscorlib/*23000003*/]System.Type/*01000008*/,
>                                                                                                                                                                                                     class [mscorlib/*23000003*/]System.Func`1/*01000014*/<object>,
>                                                                                                                                                                                                     class [mscorlib/*23000003*/]System.EventHandler`1/*01000012*/<class [Catel.Core/*23000001*/]Catel.Data.AdvancedPropertyChangedEventArgs/*01000013*/>,
>                                                                                                                                                                                                     bool,
>                                                                                                                                                                                                     bool,
>                                                                                                                                                                                                     bool) /* 2B000004 */
>   IL_005d:  /* 80   | (04)000004       */ stsfld     class [Catel.Core/*23000001*/]Catel.Data.PropertyData/*0100000E*/ AopIssue.Models.ModelWithAop/*02000003*/::IntPropertyProperty /* 04000004 */
>   IL_0062:  /* 2A   |                  */ ret
> } // end of method ModelWithAop::.cctor

At the same offset as where Mono aborted -- IL_0058 -- we see a call to Catel.Data.ModelBase::RegisterProperty<>(), which is our token ID 2B000004. Note two things:

1. It's a generic method (it contains '<>')
2. There are no generic type parameters for this "generic" method

Which explains the two peverify errors mentioned above:

> [MD]: Error: MethodSpec signature has arity 0 at byte=0x00000002. [token:0x2B000004]

It's a generic method with 0 generic arguments, which isn't valid, and

> [MD]: Error: MethodSpec method is not generic. [token:0x2B000004]

the _actual_ method that this would resolve to is NOT generic!

monop -r:Catel.Core.dll  Catel.Data.ModelBase | grep RegisterProperty
> 	public static PropertyData RegisterProperty<TModel,TValue> (System.Linq.Expressions.Expression<Func<TModel,TValue>> propertyExpression, Func<TValue> createDefaultValue, Action<TModel,AdvancedPropertyChangedEventArgs> propertyChangedEventHandler, bool includeInSerialization, bool includeInBackup, bool setParent);
> 	public static PropertyData RegisterProperty<TModel,TValue> (System.Linq.Expressions.Expression<Func<TModel,TValue>> propertyExpression, TValue defaultValue, Action<TModel,AdvancedPropertyChangedEventArgs> propertyChangedEventHandler, bool includeInSerialization, bool includeInBackup, bool setParent);
> 	public static PropertyData RegisterProperty (string name, Type type, Func<object> createDefaultValue, EventHandler<AdvancedPropertyChangedEventArgs> propertyChangedEventHandler, bool includeInSerialization, bool includeInBackup, bool setParent);
> 	public static PropertyData RegisterProperty<TValue> (string name, Type type, TValue defaultValue, EventHandler<AdvancedPropertyChangedEventArgs> propertyChangedEventHandler, bool includeInSerialization, bool includeInBackup, bool setParent);

There are only 4 RegisterProperty() methods, three of which are generic, but only one method matches the argument list in the above IL -- the non-generic RegisterProperty(string, Type, Func<object>, EventHandler<AdvancedPropertyChangedEventArgs>, bool, bool, bool) -- yet this non-generic method is being invoked in a generic fashion.

Result: .NET PEVerify.exe generates errors, and Mono aborts.

Fix your AOP weaver. It's buggy.
Comment 12 Rodrigo Kumpera 2014-04-21 17:07:06 UTC
The runtime should not abort.
Comment 13 Geert van Horrik 2014-04-22 05:50:52 UTC
I agree with Rodrigo, on "regular" .NET it works great. Even when PEVerify doesn't throw the error (with a fixed weaver), it aborts. Why does mono abort while the normal .NET runtime continues?

Still trying to find the issue in the weaver, but the IL code is the same. Will try other tools to check if I can find the culprit.
Comment 14 Geert van Horrik 2014-04-22 06:11:56 UTC
With or without AOP, this is the result of monodis (Mono-3.2.3) on my machine:

.assembly extern Mono.Android
{
  .ver 0:0:0:0
  .publickeytoken = (84 E0 4F F9 CF B7 90 65 ) // ..O....e
}
.assembly extern Catel.Core
{
  .ver 4:0:0:0
}
.assembly extern mscorlib
{
  .ver 2:0:5:0
  .publickeytoken = (7C EC 85 D7 BE A7 79 8E ) // |.....y.
}
.assembly 'AopIssue'
{
Missing method .ctor in assembly C:\Source\Research\AopIssue\AopIssue\bin\Debug\AopIssue.dll, type System.Runtime.Versioning.TargetFrameworkAttribute
* Assertion at class.c:5594, condition `!mono_loader_get_last_error ()' not met

I tried the latest version of Mono (according to release notes + website, latest is 3.4.0), but for windows it always downloads 3.2.3. See http://www.go-mono.com/mono-downloads/download.html for website.
Comment 15 Geert van Horrik 2014-04-22 06:33:50 UTC
There was an issue with redeploying to my device. After manually removing the app from my device and redeploying, the application no longer crashes. This means the bug was indeed in the weaver and is now fixed.

The only question remains: why does the normal .NET runtime not crash while the mono runtime does. But I will leave that to Rodrigo to decide.
Comment 16 Paolo Molaro 2014-08-05 08:21:50 UTC
Removed the assert when loading the method. Couldn't get MS ilasm to even compile a broken sample like described above (it ignores an empty generic argument list at the callsite), so we shouldn't crash now, but likely won't execute the broken code (an exception should be thrown up higher on the stack).