Bug 17803 - CS0119 reported without filename + line number
Summary: CS0119 reported without filename + line number
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: 3.2.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2014-02-16 14:55 UTC by Jens
Modified: 2014-02-17 11:49 UTC (History)
1 user (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 Jens 2014-02-16 14:55:16 UTC
not sure, if connected to bug CS0119

In my current project I added the Json.net component from your store and added the following line to my sources:

			using (TextWriter textWriter = File.CreateText (fileName)) {
				Newtonsoft.Json.Serialization (textWriter, allItems);

This results in the following build output:

Target CoreCompile:
	Target CoreCompile needs to be built as input file '../CoreShared/HandleBackups/CreateBackup.cs' is newer than output file 'obj/Debug/CoreAndroid.dll'
	Task "Csc"
		Using task Csc from Microsoft.Build.Tasks.Csc, Microsoft.Build.Tasks.v4.0, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
		Tool /Library/Frameworks/Xamarin.Android.framework/Versions/Current/bin/smcs execution started with arguments: [... tons of stuff removed ...]
: error CS0119: Expression denotes a `namespace', where a `variable', `value' or `method group' was expected
		Tool /Library/Frameworks/Xamarin.Android.framework/Versions/Current/bin/smcs execution finished.
	Task "Csc" execution -- FAILED
	Done building target "CoreCompile" in project "/Users/jens-uwe/Projects/letmetalk/LetMeTalk/CoreAndroid/Core.Droid.csproj".-- FAILED

As you can see, the CS0119 error comes without filename and without linenumber, so it is pretty difficult to find. I had to do some trial and error to find the reason for the message.

Wanted solution:
the compiler should report this bug with filename and linenumber, so one can find the problem immediatly and safe time to search for the problem :)
Comment 1 Jens 2014-02-16 15:00:20 UTC
I meant to write Bug 15035 as potentially connected.
But that bug is marked "resolved fixed" and the bug still happens.

I am on the current "stable" channel:

Xamarin Studio
Version 4.2.3 (build 54)
Installation UUID: ef46ec6d-cbfa-4264-bb42-00cdaa25736e
	Mono 3.2.6 ((no/9b58377)
	GTK+ 2.24.23 theme: Raleigh
	GTK# (
	Package version: 302060000

Apple Developer Tools
Xcode 5.0.2 (3335.32)
Build 5A3005

Xamarin.Mac: Not Installed

Version: (Business Edition)
Hash: 2ed9bc9
Build date: 2014-21-01 06:33:05-0500

Version: 4.10.2 (Business Edition)
Android SDK: /Users/jens-uwe/Downloads/Programme/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

Build Information
Release ID: 402030054
Git revision: f3fd2a8582693cd1728166bcfc17056235cb5b05
Build date: 2014-02-03 17:26:56+0000
Xamarin addins: b992974cc7bee7713bba6abaf2b4fac94e67dd1c

Operating System
Mac OS X 10.9.1
Darwin localhost 13.0.0 Darwin Kernel Version 13.0.0
    Thu Sep 19 22:22:27 PDT 2013
    root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
Comment 2 Marek Safar 2014-02-17 10:38:05 UTC
Fixed in master