I'm trying to migration our website from .Net 3.5 to 4 and I'm encountering a very weird issue.
Code that works just fine in 3.5 does not anymore once I target .Net4, giving me the error
"xxx is not supported by the language".
TimeZoneInfo tzi = !calendarItem.UseUserTimeZone ? user.Settings.TimeZoneInfo : l.TimeZoneItem.Info;
On that line of code the error shows on ".TimeZoneInfo
" and ".Info
" both of type "System.TimeZoneInfo
".
Definition of user.Settings.TimeZoneInfo
property is:
public TimeZoneInfo TimeZoneInfo
{
get { return World.TimeZones[Convert.ToInt32(this[Setting.TimeZoneInfo])].Info; }
set { this[Setting.TimeZoneInfo] = value.ToTimeZoneItem().Id.ToString(); }
}
Definition of l.TimeZoneItem.Info
property is:
public TimeZoneInfo Info
{
get { return info; }
}
Not really sure what's going on here. Need help on that one please.
It's probably an assembly inconsistency issue. I had this problem when I wanted to use an assembly that created a circular reference with another project. Once I fixed this circular reference issue, the error didn't appear anymore.
This also happens when a lower library is using a different versionof the .NET Framework. Had a similar issue and when I updated the Lower Libraries to 3.5 framework and the actual library to the 3.5 framework the problem went away.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With