Bug 13944 - Attributes error in VS2012 SP3 : Missing method .ctor in assembly - Can't find custom attr constructor image
Summary: Attributes error in VS2012 SP3 : Missing method .ctor in assembly - Can't fin...
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 1.3.x
Hardware: Macintosh Windows
: --- normal
Target Milestone: ---
Assignee: Dominique Louis
URL:
Depends on:
Blocks:
 
Reported: 2013-08-13 05:12 UTC by ben ishiyama-levy
Modified: 2013-09-02 23:01 UTC (History)
5 users (show)

Tags:
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 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 ben ishiyama-levy 2013-08-13 05:12:05 UTC
I noticed a few issues on VS2012 since the xamarin iOS update to mono 3x
Just to be clear, all works pretty fine on xamarin studio on Mac, but i get issues on the visual studio environment, making it impossible to run or debug on both the simulator or iphone physical devices.

The first one is the issue described on the title.
I am using attributes that are pretty much mocks entity framework data annotations.

the class looks like this:
namespace System.ComponentModel.DataAnnotations.Schema
{
    /// <summary>
    ///     The foreign key.
    /// </summary>
    [AttributeUsage(AttributeTargets.All)]
    public class ForeignKey : Attribute
    {
        #region Fields

        /// <summary>
        ///     The field.
        /// </summary>
        private string field;

        #endregion

        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="ForeignKey"/> class.
        /// </summary>
        /// <param name="field">
        /// The field.
        /// </param>
        public ForeignKey(string field)
        {
            this.field = field;
        }

        #endregion
    }

    /// <summary>
    ///     The column.
    /// </summary>
    [AttributeUsage(AttributeTargets.All)]
    public class Column : Attribute
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="Column"/> class.
        /// </summary>
        /// <param name="field">
        /// The field.
        /// </param>
        public Column(string field)
        {
        }

        #endregion
    }

    /// <summary>
    /// Denotes that a property or class should be excluded from database mapping.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
    public class NotMappedAttribute : Attribute
    {
    }

}

This (and a few other data annotations classes) sits in an assembly imaginatively called 'System.ComponentModel.DataAnnotations.', which is signed.

when running the application, i get the trace below. Again, this is a non issue on the xamarin studio environment on mac ( all at the latest version as per this entry)

Please help.

Missing method .ctor in assembly /Users/ben/Library/Caches/Xamarin/mtbs/builds/TipsterUIContainersMT/96f732d2-0f2f-4d2a-ab8f-4074bd079442/assemblies/Tipster.Model.MT.dll, type System.ComponentModel.DataAnnotations.Schema.ForeignKey
Can't find custom attr constructor image: /Users/ben/Library/Caches/Xamarin/mtbs/builds/TipsterUIContainersMT/96f732d2-0f2f-4d2a-ab8f-4074bd079442/assemblies/Tipster.Model.MT.dll mtoken: 0x0a000027
* Assertion at ../../../../../mono/mono/metadata/class.c:5594, condition `!mono_loader_get_last_error ()' not met

mono-rt: Stacktrace:


mono-rt:   at <unknown> <0xffffffff>

mono-rt:   at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <IL 0x0009f, 0xffffffff>

mono-rt:   at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38

mono-rt:   at Tipster.UI.Containers.MT.Application.Main (string[]) [0x00001] in d:\Work\tippstr\UI.Containers\MT.Container\Main.cs:28

mono-rt:   at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>

mono-rt: 
Native stacktrace:


mono-rt: 	0   TipsterUIContainersMT               0x
000b0b2a mono_handle_native_sigsegv + 266

mono-rt: 	1   TipsterUIContainersMT               0x000bd38d sigabrt_signal_handler + 109

mono-rt: 	2   libsystem_c.dylib                   0x90bad8cb _sigtramp + 43

mono-rt: 	3   ???                                 0xffffffff 0x0 + 4294967295

mono-rt: 	4   libsystem_sim_c.dylib               0x0425d57b abort + 140

mono-rt: 	5   TipsterUIContainersMT               0x00206d8c monoeg_g_logv + 188

mono-rt: 	6   TipsterUIContainersMT               0x00206dbb monoeg_assertion_message + 43

mono-rt: 	7   TipsterUIContainersMT               0x00108a1a mono_class_create_from_typedef + 298

mono-rt: 	8   TipsterUIContainersMT               0x001095f1 mono_class_get_full + 177

mono-rt: 	9   TipsterUIContainersMT               0x0010889c mono_class_from_name + 1020

mono-rt: 	10  TipsterUIContainersMT               0x00124b2f mono_exception_from_name_domain + 47

mono-rt: 	11  TipsterUIContainersMT               0x0012506a mono_get_exception_null_reference + 58

mono-rt: 
	12  TipsterUIContainersMT               0x000b106e mono_handle_exception_internal + 110

mono-rt: 	13  TipsterUIContainersMT               0x000b2199 mono_handle_exception + 41

mono-rt: 	14  TipsterUIContainersMT               0x000542ee altstack_handle_and_restore + 142

mono-rt: 	15  ???                                 0x0b58be97 0x0 + 190365335

mono-rt: 	16  ???                                 0x0b58bc94 0x0 + 190364820

mono-rt: 	17  ???                                 0x170e6944 0x0 + 386820420

mono-rt: 	18  ???                                 0x170e6107 0x0 + 386818311

mono-rt: 	19  ???                                 0x170e11a9 0x0 + 386797993

mono-rt: 	20  ???                                 0x170dcbd6 0x0 + 386780118

mono-rt: 	21  ???                                 0x170dc4d5 0x0 + 386778325

mono-rt: 	22  ???                                 0x170dbe9b 0x0 + 386776731

mono-rt: 	23  ???                                 0x170db77c 0x0 + 386774908

mono-rt: 	24  ???                              
   0x170db140 0x0 + 386773312

mono-rt: 	25  ???                                 0x170da8f0 0x0 + 386771184

mono-rt: 	26  ???                                 0x170d89cc 0x0 + 386763212

mono-rt: 	27  ???                                 0x170d8748 0x0 + 386762568

mono-rt: 	28  ???                                 0x17062d9c 0x0 + 386280860

mono-rt: 	29  ???                                 0x17062784 0x0 + 386279300

mono-rt: 	30  ???                                 0x170625b0 0x0 + 386278832

mono-rt: 	31  ???                                 0x170624b8 0x0 + 386278584

mono-rt: 	32  ???                                 0x10f92f93 0x0 + 284766099

mono-rt: 	33  ???                                 0x10f92d68 0x0 + 284765544

mono-rt: 	34  ???                                 0x10f92c68 0x0 + 284765288

mono-rt: 	35  ???                                 0x10f92ba8 0x0 + 284765096

mono-rt: 	36  ???                                 0x10f92a98 0x0 + 284764824

mono-rt: 	37  ???                                 0x10f8d
ccc 0x0 + 284744908

mono-rt: 	38  ???                                 0x10f8df4c 0x0 + 284745548

mono-rt: 	39  TipsterUIContainersMT               0x000de845 mono_jit_runtime_invoke + 741

mono-rt: 	40  TipsterUIContainersMT               0x0018490e mono_runtime_invoke + 126

mono-rt: 	41  TipsterUIContainersMT               0x0022cc3e monotouch_trampoline + 3822

mono-rt: 	42  UIKit                               0x02798157 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 266

mono-rt: 	43  UIKit                               0x02798747 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1248

mono-rt: 	44  UIKit                               0x0279994b -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 805

mono-rt: 	45  UIKit                               0x027aacb5 -[UIApplication handleEvent:withNewEvent:] + 1022

mono-rt: 	46  UIKit                               0x027abbeb -[UIApplication sendEvent:] + 85

mono-r
t: 	47  UIKit                               0x0279d698 _UIApplicationHandleEvent + 9874

mono-rt: 	48  GraphicsServices                    0x04d8fdf9 _PurpleEventCallback + 339

mono-rt: 	49  GraphicsServices                    0x04d8fad0 PurpleEventCallback + 46

mono-rt: 	50  CoreFoundation                      0x0130ebf5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53

mono-rt: 	51  CoreFoundation                      0x0130e962 __CFRunLoopDoSource1 + 146

mono-rt: 	52  CoreFoundation                      0x0133fbb6 __CFRunLoopRun + 2118

mono-rt: 	53  CoreFoundation                      0x0133ef44 CFRunLoopRunSpecific + 276

mono-rt: 	54  CoreFoundation                      0x0133ee1b CFRunLoopRunInMode + 123

mono-rt: 	55  UIKit                               0x0279917a -[UIApplication _run] + 774

mono-rt: 	56  UIKit                               0x0279affc UIApplicationMain + 1211

mono-rt: 	57  ???                                 0x10f8a1aa 0x0 + 284729770

mono-rt: 	58  ???            
                     0x10f8846c 0x0 + 284722284

mono-rt: 	59  ???                                 0x10f87fe0 0x0 + 284721120

mono-rt: 	60  ???                                 0x10f88127 0x0 + 284721447

mono-rt: 	61  TipsterUIContainersMT               0x000de845 mono_jit_runtime_invoke + 741

mono-rt: 	62  TipsterUIContainersMT               0x0018490e mono_runtime_invoke + 126

mono-rt: 	63  TipsterUIContainersMT               0x00188914 mono_runtime_exec_main + 420

mono-rt: 	64  TipsterUIContainersMT               0x00188c85 mono_runtime_run_main + 725

mono-rt: 	65  TipsterUIContainersMT               0x0004d165 mono_jit_exec + 149

mono-rt: 	66  TipsterUIContainersMT               0x002213f4 main + 1988

mono-rt: 	67  TipsterUIContainersMT               0x000034b5 start + 53

mono-rt: 
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your applicat
ion.
=================================================================
The program 'Mono' has exited with code 0 (0x0).
The program '[8580] TipsterUIContainersMT.vshost.exe: Program Trace' has exited with code 0 (0x0).
The program '[8580] TipsterUIContainersMT.vshost.exe: Managed (v4.0.30319)' has exited with code -1 (0xffffffff).
Comment 1 Dominique Louis 2013-08-16 08:36:39 UTC
Hi Ben,
  Could you please confirm that that System.ComponentModel.DataAnnotations.dll exists in...
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoTouch\v4.0

Thanks.
Comment 2 ben ishiyama-levy 2013-09-02 23:01:55 UTC
Hi,

Did not realise we now have a System.ComponentModel.DataAnnotations.dll official assembly.

this solved it!.

Merci Buckets.

Ben