[Mono-aspnet-list] Using C# 3.0? Error due to 2.0

william leader william.leader at gmail.com
Fri Aug 6 10:29:11 EDT 2010


Hello Marek,

The Short version is that I think it is important to use the same
terms as Microsoft when discussing the compatibility between Mono and
.Net. For example "Auto-Implemented Properties" is the term used in
Microsoft documentation, but does not appear at all on
mono-project.com. Someone who knows this term for a feature and wants
to know if Mono supports a given feature and doesn't find it by name
in search engine results is likely to think the feature is not yet
available.

What follows is an attempt to rationalize away why I was corrected and
make myself feel better. Feel free to stop reading here.

It seems every time I open my mouth on the mono lists I get corrected,
but I suppose I take that risk for myself.

I find it frustrating that I did do a little research of my own before
attempting to answer and still managed to make a bit of a fool of
myself. I would like to point out that Microsoft uses the term
"Auto-Implemented Properties" so I thought my search on Google for
Mono and Auto-Implemented Properties was completely reasonable and
appropriate. The problem is that search turned up nothing that I could
pass on to Jakob. In comparison, the search for 'mono automatic
properties' returns http://www.mono-project.com/CSharp_Compiler as the
first result. This page does say that recent versions of mono are C#
3.0 feature complete (Great Job! BTW). Had I found that page with a
search that used the Microsoft term, things might have been different.

Oh well. I wish I was able to use Mono more often than just in my
spare time in the evenings and then I would know these things...

-Will


On Fri, Aug 6, 2010 at 2:52 PM, Marek Habersack <grendel at twistedcode.net> wrote:
> On Fri, 6 Aug 2010 07:22:52 +0100
> william leader <william.leader at gmail.com> wrote:
>
> Hey,
>
>> To the best of my knowledge there are three options here:
>>
>> 1) Change your code to contain full property implementations. Its not
>> that much work. This was my choice.
>>
>> 2) Add support for auto-implemented properties to Mono and submit a
>> patch. Good luck.
> They've been supported for ~2 years now
>
>>
>> 3) Wait for someone else to add support for it to Mono. Good Luck.
>
> There's nothing Mono specific to this error, the same thing would have happened on .NET 3.5. The
> reason is that the .NET 3.5 compiler defaults to C# 2.0 and you need to let it know you're using C#
> 3.0 features in your _dynamically_ compiled code (i.e. code in App_Code or in files mentioned in
> the CodeFile attribute). You do this by adding the following section to your web.config:
>
> <system.codedom>
>      <compilers>
>        <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4"
>                  type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0,
> Culture=neutral, PublicKeyToken=b77a5c561934e089"> <providerOption name="CompilerVersion"
> value="v3.5"/> <providerOption name="WarnAsError" value="false"/>
>        </compiler>
>        <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4"
>                  type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0,
> Culture=neutral, PublicKeyToken=b77a5c561934e089"> <providerOption name="CompilerVersion"
> value="v3.5"/> <providerOption name="OptionInfer" value="true"/>
>          <providerOption name="WarnAsError" value="false"/>
>        </compiler>
>      </compilers>
>    </system.codedom>
>
> No need for any of the workarounds you gave above
>
> marek
>
>> On Thu, Aug 5, 2010 at 11:35 PM, Dizzy <hohenberger.jakob at gmail.com> wrote:
>> >
>> > Hey,
>> >
>> > I'm used to implement properties automatically. public Foo {get;set;}.
>> >
>> > Can I fix this error
>> >
>> > -- Code ---
>> > error CS1644: Feature `automatically implemented properties' cannot be used
>> > because it is not part of the C# 2.0 language specification
>> > --- Code End ---
>> >
>> > without rewriting?
>> >
>> > Thanks
>> > Jakob
>> >
>> > Edit: I'm using the latest mono version for Debian Lenny.
>> > --
>> > View this message in context:
>> > http://mono.1490590.n4.nabble.com/Using-C-3-0-Error-due-to-2-0-tp2315695p2315695.html Sent from
>> > the Mono - ASP.NET mailing list archive at Nabble.com.
>> > _______________________________________________ Mono-aspnet-list mailing list
>> > Mono-aspnet-list at lists.ximian.com
>> > http://lists.ximian.com/mailman/listinfo/mono-aspnet-list
>> >
>> _______________________________________________
>> Mono-aspnet-list mailing list
>> Mono-aspnet-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-aspnet-list
>
>


More information about the Mono-aspnet-list mailing list