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

Marek Habersack grendel at twistedcode.net
Fri Aug 6 10:46:29 EDT 2010


On Fri, 6 Aug 2010 15:29:11 +0100
william leader <william.leader at gmail.com> wrote:

Hello,
[snip]
> 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.
You shouldn't take it personally. Everyone who makes a mistake (and we all do, every single one of
us) should expect (and be happy) that somebody corrects them. This is the only way to learn -
because when you do something that's impeccable, it means you already knew all the answers, so you
haven't advanced by doing it. And look at it from another perspective - the next person to google
for solutions for this problem will find the thread and get the information they need. Pure gain
for the community, and that's what counts here.

> 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
And this is the reason why you got corrected :) (and, once again, everybody makes that mistake once
in a while). I'm sure next time you will do more research :)

> 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.
OK, to pick up your game :) - the correct search term (given the subject of this thread) would be
"mono support C# 3.0" which would give the answer right away. And the next step would be to search
for "enable C# 3.0 asp.net compiler" which would reveal the answer I posted in the previous mail :)

marek
> 
> -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