Not something you would recommend then. I will look for another way I guess.

Thank you for your message.

Le lundi 17 septembre 2018 23:07:47 UTC+7, Jb Evain a écrit :
>
> Hey Martin,
>
> From the C# you're showing, that looks like a big breaking change. Turning 
> fields and methods static is going to break a lot of things, and will 
> require you to change basically all the code using those fields and methods.
>
> Jb
>
> On Mon, Sep 17, 2018 at 9:03 AM Martin Finkel <[email protected] 
> <javascript:>> wrote:
>
>> Hello,
>>
>> I'm using a Fody weaver to modify a xamarin.ios dll post build to satisfy 
>> the [MonoPInvokeCallback] requirements.
>>
>> foreach (var type in ModuleDefinition.Types)
>> {
>>     foreach (var f in type.Fields.Where(IsEventHandler))
>>     {
>>         f.IsStatic = true;
>>     }
>>
>>     foreach (var m in type.Methods.Where(NeedStaticKeyword))
>>     {
>>         m.IsStatic = true;
>>         m.HasThis = false;
>>     }
>> }
>>
>>
>> This makes PEVerify complain about IL
>>
>> 2>MSBUILD : error : [IL]: 
>> LibVLCSharp.Shared.MediaPlayer::add_PositionChanged][offset 0x00000038] 
>> Unrecognized arguments for delegate .ctor.(Error: 0x801318AA)
>> 2>MSBUILD : error : [IL]: 
>> LibVLCSharp.Shared.MediaPlayer::remove_PositionChanged][offset 0x00000038] 
>> Unrecognized arguments for delegate .ctor.(Error: 0x801318AA)
>> 2>MSBUILD : error : [IL]: 
>> LibVLCSharp.Shared.MediaPlayer::OnPositionChanged][offset 0x00000002][found 
>> Native Int][expected ref 'LibVLCSharp.Shared.MediaPlayer'] Unexpected type 
>> on the stack.(Error: 0x80131854)
>> 2>MSBUILD : error : [IL]: 
>> LibVLCSharp.Shared.MediaPlayer::OnPositionChanged][offset 0x0000000E] 
>> Unrecognized argument number.(Error: 0x80131868)
>>
>>
>> I had a look at the `Body.Instructions` of the concerned methods/events, 
>> and tried removing `OpCodes.Ldarg_0` but that caused other issues and I 
>> don't even know if that's the right way to deal with those errors. I'm far 
>> from fluent in IL.
>>
>> Any help is greatly appreciated.
>>
>> Best,
>>
>> mfkl
>>
>> -- 
>> -- 
>> --
>> mono-cecil
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "mono-cecil" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
--
mono-cecil
--- 
You received this message because you are subscribed to the Google Groups 
"mono-cecil" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to