How do I tell NAnt to use the same VB compiler VS2008 uses when it creates .NET 2.0-targeting applications?
I have switched a web application to VS2008 back-targetted to .NET 2.0. I can run NAnt (0.85rc4, 0.85, and 0.86b1) just fine once I do this. When I try to use some of the VB9 syntax, that still compiles just fine back to a .NET 2.0 binary in VS2008, NAnt gets the kind of compile error you would get if you tried to do the new syntax in VS2005 (where it wasn't supported).
In case it helps, here is a simplified version of what I am attempting, just a simple anonymous delegate that works great until I try to use NAnt to build the 2.0 app instead of VS2008.
Public Class SomeObject
Public Name As String
End Class
Private SomeList As List(Of SomeObject) = SomeObject.GetAllSomeObjects()
Public Function FindFirstItemWithSimilarName(ByVal x As String) As SomeObject
Return SomeList.Find(Function(p As SomeObject) p.Name.Contains(x))
End Function
EDIT: Unless someone can think of a reason not to, the current setting in my build file is this (since I do indeed want a .NET 2.0 application, just one generated by a more robust VB compiler):
<property name="nant.settings.currentframework" value="net-2.0"/>