This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 47353 - Mono.CSharp.MetadataImporter.set_IgnoreCompilerGeneratedField not found when running Cake on Mono 4.8
Summary: Mono.CSharp.MetadataImporter.set_IgnoreCompilerGeneratedField not found when ...
Status: CLOSED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: Other (show other bugs)
Version: 4.8.0 (C9)
Hardware: PC Mac OS
: --- normal
Target Milestone: 4.8.0 (C9)
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2016-11-18 14:00 UTC by Alexander Köplinger [MSFT]
Modified: 2017-03-03 21:35 UTC (History)
5 users (show)

See Also:
Tags:
Is this bug a regression?: Yes
Last known good build: 4.6 / C8


Attachments

Description Alexander Köplinger [MSFT] 2016-11-18 14:00:57 UTC
Reported by https://github.com/cake-build/cake/issues/1368.

When running Cake on Mono 4.8 it fails with "Method 'Mono.CSharp.MetadataImporter.set_IgnoreCompilerGeneratedField' not found".

The issue is that they bundle an old Mono.CSharp.dll which gets loaded and we now try to set the property above from Microsoft.CSharp.dll which is only present in a newer version since https://github.com/mono/mono/commit/5da8cfe05df331723584997bb9bbc6ac961c12d4.

Resolution: stop bundling Mono.CSharp.dll or use a different assembly name.
Comment 1 Marek Safar 2016-12-12 16:39:15 UTC
Fixed in master and Mono 4.8
Comment 2 Saurabh 2017-02-02 08:52:49 UTC
I have tried to reproduce this Issue with Mono 4.8.0.350 and XS 6.2 (Build 1505) using FastlaneLecture project from https://github.com/ghuntley/appstore-automation-with-fastlane but application getting build and deployed successfully on device and Simulator.

Application Output: https://gist.github.com/saurabh360/9b7fed28ba39f6719be49198c40e454f
Build Output: https://gist.github.com/saurabh360/fe675494f10a108c043f6c902e2fadf9


@Alexander/Marek, Could you please let me know how can I reproduce this Issue so that I can verify it?
Comment 3 Shruti 2017-02-07 06:34:32 UTC
@Marek, It would be great if you have a look comment2. We are looking for your valuable feedback, will help us to reproduce and verify this issue.

Thanks!!
Comment 4 Marek Safar 2017-02-07 15:38:59 UTC
The simple way I can think of reproducing it is to create simple C# program which does some dynamic operation

like 

dynamic d = 1;
Console.WriteLine (d + 2);

if you also reference Mono.CSharp nuget you should get execution error (this assumes nuget content is copied to bin folder)
Comment 5 Mohit Kheterpal 2017-02-07 16:47:35 UTC
@Marek 

To reproduce this issue I have created a console project of C# in XS and add the code that you have provided in comment 4,

using System;

namespace hghgh
{
	class MainClass
	{
		public static void Main(string[] args)
		{
			dynamic d = 1;
			Console.WriteLine(d + 2);
		}
	}
}

But it give build error with latest mono 4.8 and the mono that contains the issue however if I add Microsoft.CSharp in its Reference then it build successfully with both mono i.e. with Latest mono MonoFramework-MDK-4.8.0.487.macos10.xamarin.universal_df82e0775c5eaddc710eea4af8107c28861b190b and with MonoFramework-MDK-4.8.0.192.macos10.xamarin.universal_951f3c883789315cb02d79ade7247c9868296e55

I am not getting any difference, please let me know If I missed something to reproduce this issue?

Thanks
Comment 6 Mohit Kheterpal 2017-02-07 16:49:02 UTC
Build output for comment 5 : https://gist.github.com/Mohit-Kheterpal/b0badf2fd3e8f4fadd69866845660a85
Comment 7 Marek Safar 2017-02-07 17:03:07 UTC
Did you add Mono.CSharp nuget? Can you attach your project?
Comment 9 Marek Safar 2017-02-08 10:38:34 UTC
I guess If you really want to reproduce you'll have to use cake-build steps to repro
Comment 10 Mohit Kheterpal 2017-02-08 13:16:19 UTC
I am not sure about the cake-build steps, I have searched it on google and find a Cake.Xamarin test sample from https://github.com/Redth/Cake.Xamarin and run this sample in XS using MonoFramework-MDK-4.8.0.487.macos10.xamarin.universal_df82e0775c5eaddc710eea4af8107c28861b190b and with MonoFramework-MDK-4.8.0.192.macos10.xamarin.universal_951f3c883789315cb02d79ade7247c9868296e55 and I am getting same behaviour.  

I m not sure, I am in right direction to verify this issue.

Note You need to log in before you can comment on or make changes to this bug.