Lambda expressions delegates problems migrate .net 2.0 to .net 3.5 web app


On migrate some code from .net 2.0 to 3.5 in an web application i was trying some of the linq to objects queries on an specific data types. So far so good, but compiler said –“ “.

the application has and c# code also before linq syntax correctly compilable .

resolution was chaging the properties of the class from : 

   1:  public class myDataObject
   2:  {
   3:      private int _FeatureID; 
   5:      public int FeatureID
   6:      {
   7:          get { return _FeatureID; }
   8:          set { _FeatureID = value; }
   9:      } 
  11:  } 


public class myDataObject 

    public string FeatureID { get; set; }


and adding to web.config compiler specific settings

     <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
       <providerOption name="CompilerVersion" value="v3.5" />
       <providerOption name="WarnAsError" value="false" />


Technorati-Tags: ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s