vb.net - Restrict new language features of Visual Basic in Visual Studio 2015 -


i'm working on visual basic project team of developers, of able move visual studio 2015 released, , stuck on visual studio 2013 several months. in testing rc have found visual studio open 2013 projects without problem, happily let users use new language features, such string interpolation, not available users in vs 2013. if 2015 user checks in code 2013 users compile errors. there project, solution, or visual studio setting tell compiler restrict features available in previous version of vb.net? ideally compiler should return compile error when trying use these features in 2015.

this features available in c# under project properties > build > language version, can't find equivalent vb.net, , google searches failing me.

i wanted mention setting .net runtime version 4.5 doesn't help, these new language features compiler level features work fine on older frameworks.

there no ui feature set language version, can unload project file , add <langversion>11</langversion> default visual basic 2012/2013 language settings. c# project adds property under project configuration property groups, consistency's sake i've done same in sample below.

the c# property pages same thing, except c# uses different set of version numbers.

a full set of language versions can found here.

2002 (vb 7.0) 2003 (vb 7.1) 2005 (vb 8.0) 2008 (vb 9.0) 2010 (vb 10.0) 2012 (vb 11.0) 2015 (vb 14) 

just tested , works me, did have change casing to:

enter image description here

this results in:

enter image description here

and nice build failure:

enter image description here


Comments