This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 8561 - CS1061 error when referencing F# assemblies
: CS1061 error when referencing F# assemblies
Status: RESOLVED FIXED
Product: Compilers
Classification: Mono
Component: C#
: unspecified
: Macintosh Mac OS
: --- normal
: ---
Assigned To: Marek Safar
:
:
:
:
  Show dependency treegraph
 
Reported: 2012-11-22 18:08 EST by Daniel Fabian
Modified: 2012-11-23 12:14 EST (History)
2 users (show)

See Also:
Tags:
Test Case URL: https://github.com/DanielFabian/MonoCSharpBug
External Submit: ---


Attachments

Description Daniel Fabian 2012-11-22 18:08:02 EST
When trying to add a reference to a FSharp assembly, the compiler does not
recognize any types.

XBuild Engine Version 3.0.1.0
Mono, Version 3.0.1.0
Copyright (C) Marek Sieradzki 2005-2008, Novell 2008-2011.

Build started 22.11.2012 23:41:41.
__________________________________________________
Project "/Users/dany/MonoCSharpBug/FSharpProj/FSharpProj.sln" (default
target(s)):
    Target ValidateSolutionConfiguration:
        Building solution configuration "Debug|Any CPU".
    Target Build:
        Project "/Users/dany/MonoCSharpBug/FSharpProj/FSharpProj.fsproj"
(default target(s)):
            Target PrepareForBuild:
                Configuration: Debug Platform: AnyCPU
            Target GenerateSatelliteAssemblies:
            No input files were specified for target
GenerateSatelliteAssemblies, skipping.
            Target CoreCompile:
            Skipping target "CoreCompile" because its outputs are up-to-date.
        Done building project
"/Users/dany/MonoCSharpBug/FSharpProj/FSharpProj.fsproj".
        Project "/Users/dany/MonoCSharpBug/CSharpProj/CSharpProj.csproj"
(default target(s)):
            Target PrepareForBuild:
                Configuration: Debug Platform: AnyCPU
            Target GenerateSatelliteAssemblies:
            No input files were specified for target
GenerateSatelliteAssemblies, skipping.
            Target CoreCompile:
                Tool /Library/Frameworks/Mono.framework/Versions/3.0.1/bin/dmcs
execution started with arguments: /noconfig /debug:full /debug+ /optimize-
/out:obj/Debug/CSharpProj.exe Main.cs AssemblyInfo.cs /target:exe /define:DEBUG
/reference:/Library/Frameworks/Mono.framework/Versions/3.0.1/lib/mono/4.0/System.dll
/reference:/Library/Frameworks/Mono.framework/Versions/3.0.1/lib/mono/4.0/System.Core.dll
/reference:/Users/dany/MonoCSharpBug/FSharpProj/bin/Debug//FSharpProj.dll
/warn:4
Main.cs(10,40): error CS1061: Type `string' does not contain a definition for
`World' and no extension method `World' of type `string' could be found. Are
you missing an assembly reference?
               
/Library/Frameworks/Mono.framework/Versions/3.0.1/lib/mono/4.0/mscorlib.dll
(Location of the symbol related to previous error)
            Task "Csc" execution -- FAILED
            Done building target "CoreCompile" in project
"/Users/dany/MonoCSharpBug/CSharpProj/CSharpProj.csproj".-- FAILED
        Done building project
"/Users/dany/MonoCSharpBug/CSharpProj/CSharpProj.csproj".-- FAILED
    Task "MSBuild" execution -- FAILED
    Done building target "Build" in project
"/Users/dany/MonoCSharpBug/FSharpProj/FSharpProj.sln".-- FAILED
Done building project "/Users/dany/MonoCSharpBug/FSharpProj/FSharpProj.sln".--
FAILED

Build FAILED.
Errors:

/Users/dany/MonoCSharpBug/FSharpProj/FSharpProj.sln (default targets) ->
(Build target) ->
/Users/dany/MonoCSharpBug/CSharpProj/CSharpProj.csproj (default targets) ->
/Library/Frameworks/Mono.framework/Versions/3.0.1/lib/mono/4.0/Microsoft.CSharp.targets
(CoreCompile target) ->

    Main.cs(10,40): error CS1061: Type `string' does not contain a definition
for `World' and no extension method `World' of type `string' could be found.
Are you missing an assembly reference?

     0 Warning(s)
     1 Error(s)

Time Elapsed 00:00:01.8570570

I'm using the current F# 3.0 compiler and the C# compiler which comes with
3.0.1. The bug is reproducible with the source code in my GitHub repo.

https://github.com/DanielFabian/MonoCSharpBug

Also, I verified, that the bug is NOT in the F# compiler, we tried building my
repo on windows and it worked and we also tried building the F# project on OS X
and then reference the dll under windows, which also worked.
Comment 1 Marek Safar 2012-11-23 12:14:22 EST
Fixed in master

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