Bug 8561 - CS1061 error when referencing F# assemblies
Summary: CS1061 error when referencing F# assemblies
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2012-11-22 18:08 UTC by Daniel Fabian
Modified: 2012-11-23 12:14 UTC (History)
2 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 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:
Status:
RESOLVED FIXED

Description Daniel Fabian 2012-11-22 18:08:02 UTC
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 UTC
Fixed in master