To reproduce the error I’m getting:
- Create a new Visual Studio 2010 ASP.NET web site in Visual Basic, targeting .NET 2.0
- Type “Public Property Test As String”
- Observe “Visual Basic 9.0 does not support auto-implemented properties.” error
Visual Studio 2010 is happy to use VB 10 against .NET 2.0-targeted Windows Forms applications, this only appears to be an issue with ASP.NET.
Is there a way to force Visual Studio 2010 to use VB 10 when targeting .NET 2.0?
No. A Web Site project is one that compiles within ASP.NET at runtime – as such, you’ve chosen to ask ASP.NET to run it as a .NET 2.0 project, so it will use the .NET 2.0
vbcVisual Basic compiler that’s part of .NET. That compiler has no knowledge of VB 10, and so you’re rightly being warned that it will not work.The reason it can work for other project types is because the compilation is happening using a later compiler (usually the one built into Visual Studio).