Last post Nov 24, 2010 12:07 PM by drmacy
Nov 23, 2010 02:29 PM|drmacy|LINK
I just upgraded from Visual Studio 2005 to Visual Studio 2010 yesterday. I tried opening my site; it started the conversion wizard and seemed to work OK. However, I get the error "Visual Basic 9.0 does not support this kind of lambda expression." Here is
Dim MatchLength As Integer = Url.Path.Length
Dim D As GetRedirectedUrlDelegate = _
Dim NewQuerystring As QuerystringContext = Url.QuerystringContext.Clone()
Return Url.Clone(NewPath, NewQuerystring)
Match = New RedirectMatch(MatchLength, d)
The error is on the "Function()" line. I thought multi-line lambda functions were one of the new VS2010 features. Why am I getting a VB9.0 error in VS2010?
Nov 24, 2010 12:07 PM|drmacy|LINK
I found the answer. In the project properties, on the Build tab, the target framework was set to .NET 2.0 (presumably when the site was converted from VS2005 to VS2010). When I changed it to .NET 4.0, it works.