mike horsley | 14 Oct 16:21
Favicon

problems compiling using System.Configuration using Mono 2.0

I can use the following on MS:

System.Configuration.ConfigurationManager.AppSettings(……..)

 

This requires a reference to System.Configuration.

 

I’m trying to do the same on mono 2.0 (using the VMWARE image) but cant figure out what reference I need to give mcs to get it to compile.

 

I’ve tried “-r:System.Configuration.dll” and get the mcs error “cannot find metadata file ‘System.Configuration.dll” whereas if I use  “-r:System.Configuration.Install.dll” (having found the dlls in /user/lib/mono/2.0/) I get the mcs error “Error CS0234 the type or namespace ‘ConfigurationManager’ does not exist in the namespace ‘System.Configuration’ are you missing an assembly reference?

 

I can use the legacy mode ConfigurationSettings.AppSettings but this then means I have 2 variants of code (one for Windows, one for Linux)

 

Any help appreciated!

Mike

 

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Bill Holmes | 14 Oct 17:56

Re: problems compiling using System.Configuration using Mono 2.0

Hi,

Try gmcs instead of mcs.

-bill

2008/10/14 mike horsley <mhorsley <at> vqlive.com>:
> I can use the following on MS:
>
> System.Configuration.ConfigurationManager.AppSettings(……..)
>
>
>
> This requires a reference to System.Configuration.
>
>
>
> I'm trying to do the same on mono 2.0 (using the VMWARE image) but cant
> figure out what reference I need to give mcs to get it to compile.
>
>
>
> I've tried "-r:System.Configuration.dll" and get the mcs error "cannot find
> metadata file 'System.Configuration.dll" whereas if I use
>  "-r:System.Configuration.Install.dll" (having found the dlls in
> /user/lib/mono/2.0/) I get the mcs error "Error CS0234 the type or namespace
> 'ConfigurationManager' does not exist in the namespace
> 'System.Configuration' are you missing an assembly reference?
>
>
>
> I can use the legacy mode ConfigurationSettings.AppSettings but this then
> means I have 2 variants of code (one for Windows, one for Linux)
>
>
>
> Any help appreciated!
>
> Mike
>
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list <at> lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
mike horsley | 16 Oct 11:01
Favicon

problems compiling using System.Configuration using

Bill

 

Using gmcs was the answer. Many thanks

 

Mike

 

Mike Horsley
VQ Communications Ltd
mhorsley <at> vqlive.com
T: 01249-460002
M:07920-151804
W:www.vqlive.com

 

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Gmane