Bug 12233 - F# extension methods fail [regression]
Summary: F# extension methods fail [regression]
Alias: None
Product: Tools
Classification: Mono
Component: xbuild ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2013-05-14 10:13 UTC by logibit+monobugs
Modified: 2018-03-15 10:40 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 logibit+monobugs 2013-05-14 10:13:38 UTC
Given an sln with two projects. One C#, one F# project.

In F# project,

namespace A.B
module Interop =
  [<CompiledName("RunExtension"); Extension>]
  let abc (a, b, c, d) =

in C# project that references F# project:

namespace A.B.C.D
public static class X
  public static void Y() {
    var o = new object();
    var res = o.RunExtension(2, 3, 4);

Will compile on 3.0.3 on OS X and 3.0.6 on Linux but not on 3.0.10 on OS X, with error message during compilation on sln file:

"xbuild" "/verbosity:minimal" "src/Ex.sln"
XBuild Engine Version
Mono, Version
Copyright (C) Marek Sieradzki 2005-2008, Novell 2008-2011.
		Configuration: Debug Platform: AnyCPU
	Configuration: Debug Platform: AnyCPU
X.cs(88,36): warning CS1998: Async block lacks `await' operator and will run synchronously
X.cs(81,25): error CS1061: Type `object' does not contain a definition for `ConvertEvent' and no extension method `ConvertEvent' of type `object' could be found. Are you missing an assembly reference?
/Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error)
Comment 1 logibit+monobugs 2013-05-14 10:14:38 UTC
`ConvertEvent' and no extension method `ConvertEvent' of type `object' could be
found. Are you missing an assembly reference?

Should be


in this example.
Comment 2 logibit+monobugs 2013-05-14 10:19:39 UTC
I just tried with 3.0.9 on OS X where it works as expected.
Comment 3 logibit+monobugs 2013-05-14 10:44:32 UTC
I take that back; it also doesn't work on 3.0.9, I hadn't cleaned the solution after building in the Windows VM.

Going to go backward a bit more to see where I get a lucky strike.
Comment 4 logibit+monobugs 2013-05-14 10:56:41 UTC
Adding repro solution.
Comment 5 Mauricio Scheffer 2013-11-25 20:18:07 UTC
It seems I just ran into this bug too: https://github.com/mausch/Fuchu/commit/9bcf93bba9d8f634b745baa512b9129454e2b3f6

Using 3.2.5 on Linux.

I wonder how this is different from bug 8561 (which is working fine).
Comment 6 Marek Safar 2018-03-15 10:40:02 UTC
We deprecated xbuild and recommend using msbuild instead. Switching to msbuild will also most likely resolve the issue you reported.