Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to force Visual Studio 2010 to use Visual Basic 10?

To reproduce the error I'm getting:

  1. Create a new Visual Studio 2010 ASP.NET web site in Visual Basic, targeting .NET 2.0
  2. Type "Public Property Test As String"
  3. 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?

like image 330
overslacked Avatar asked Dec 04 '25 13:12

overslacked


1 Answers

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 vbc Visual 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).

like image 50
Damien_The_Unbeliever Avatar answered Dec 07 '25 01:12

Damien_The_Unbeliever



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!