Search code examples
monodevelop

Data does not exist in the namespace System


Can anyone throw any light on the following error importing System.Data:

/home/baloo/HellooCSharp/HellooCSharp/HellooCSharp.cs(14,14): Error CS0234: The type or namespace name `Data' does not exist in the namespace `System'. Are you missing `System.Data' assembly reference? (CS0234) (HellooCSharp)

Build command:

Building: HellooCSharp (Debug|x86)
Performing main compilation...
/usr/bin/mcs /noconfig "/r:/usr/lib/mono/4.5/mscorlib.dll" -nostdlib "/out:/home/baloo/HellooCSharp/HellooCSharp/bin/Debug/HellooCSharp.exe" "/r:/usr/lib/mono/4.5/System.dll" "/r:/usr/lib/mono/4.5/System.Core.dll" /nologo /warn:4 /debug:full /optimize- /codepage:utf8 /platform:x86 "/define:DEBUG"  /t:exe "/home/baloo/HellooCSharp/HellooCSharp/Properties/AssemblyInfo.cs" "/home/baloo/HellooCSharp/HellooCSharp/HellooCSharp.cs" 
Compilation failed: 2 error(s), 0 warnings

The assembly ca be found in /usr/lib/mono/4.5, which has been duly configured in the build assembly folders preferences dialog. [Edit: mcs compiles the test code fine with this added to the command line.]

Fedora 23, mono-core and -data rpm version 4.0.5. [Edit: MonoDevelop Version 5.9.7 (build 9)]


Solution

  • Hint: Are you missing `System.Data' assembly reference?

    You need to reference System.Data in order for it to be found/resolved. Importing System does not import System.Data