Following the Tasky application's core, I created the business and database layers, however when trying to compile I get this error:

Error CS0119: Expression denotes a 'value', where a 'method group' was expected (CS0119) (assales.core)

The problem is that there is no line number nor file reference to go along with the error as would normally would occur with a compilation error. This makes me assume that perhaps there is an issue with the project options, but that's just a guess and there are many options. What specifically do I need to do to either locate the error or get more information on this error.

The full build output:

Building: assales.core (Debug)
Performing main compilation...
/Library/Frameworks/Mono.framework/Versions/2.10.12/bin/dmcs /noconfig "/out:/Users/sb/assales/assales.core/bin/Debug/assales.core.dll" "/r:/Library/Frameworks/Mono.framework/Versions/2.10.12/lib/mono/4.0/System.dll" "/r:/Library/Frameworks/Mono.framework/Versions/2.10.12/lib/mono/4.0/System.Data.dll" "/r:/Library/Frameworks/Mono.framework/Versions/2.10.12/lib/mono/4.0/Mono.Data.Sqlite.dll" "/r:/Library/Frameworks/Mono.framework/Versions/2.10.12/lib/mono/4.0/System.Data.Linq.dll" "/r:/Library/Frameworks/Mono.framework/Versions/2.10.12/lib/mono/4.0/System.Xml.Linq.dll" "/r:/Library/Frameworks/Mono.framework/Versions/2.10.12/lib/mono/4.0/System.Core.dll" /nologo /warn:4 /debug:full /optimize- /codepage:utf8 "/define:DEBUG"  /t:library "/Users/sb/assales/assales.core/AssemblyInfo.cs" "/Users/sb/assales/assales.core/DL/SqlLite.cs" "/Users/sb/assales/assales.core/DL/AlcSalesDatabase.cs" "/Users/sb/assales/assales.core/BusinessLayer/Contracts/BusinessEntityBase.cs" "/Users/sb/assales/assales.core/BusinessLayer/Contracts/IBusinessEntity.cs" "/Users/sb/assales/assales.core/BusinessLayer/Location.cs" "/Users/sb/assales/assales.core/BusinessLayer/Managers/LocationManager.cs" "/Users/sb/assales/assales.core/DAL/LocationRepository.cs" 
Compilation failed: 1 error(s), 0 warnings

error CS0119: Expression denotes a `value', where a `method group' was expected


Build complete -- 1 error, 0 warnings

---------------------- Done ----------------------

Build: 1 error, 0 warnings
1

There are 1 best solutions below

0
On

I think it's a problem of the mono compiler. If I omit the "new" keyword in a statement that uses var:

// "var" version
public class App {
   public static void Main() {
      //missing keyword "new"
      var bitArray = System.Collections.BitArray(); 
   }
}

the compiler does not indicate row number either file name:

$ mcs App.cs
error CS0119: Expression denotes a `type', where a `variable', `value' or `method group' was expected

If instead I declare explicitly bitArray (without using "var"):

public class App {
   public static void Main() {
      //missing keyword "new"
      System.Collections.BitArray bitArray = System.Collections.BitArray(); 
   }
}

the compiler works well:

$ mcs App.cs
App.cs(3,27): error CS0119: Expression denotes a `type', where a `variable', `value' or `method group' was expected
was expected

My mcs version is:

$mcs --version
Mono C# compiler version 3.2.3.0

By the way, the Microsoft compiler works well also with "var version" of App.cs

/cygdrive/c/WINDOWS/Microsoft.NET/Framework/v4.0.30319/csc.exe App.cs
Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1
Copyright (C) Microsoft Corporation. All rights reserved.

App.cs(4,23): error CS0119: 'System.Collections.BitArray' is a 'type', which is not valid in the given context