2

I have an old ASP.NET Web Forms web site (VB) that I created years ago.

I am currently working with Visual Studio 2017, my web site is targeting the .NET 4.5 framework and everything works correctly.

Except when I try to use multi-line string literals, then I get this message:

"Visual Basic 12.0 does not support multi-line string literals."

But I know VS 2017 comes with VB 15. And if I create a new empty web site (VB) project, then I can use multi-line strings with no problems. So I guess I have to update a setting somewhere?

Please help. Thanks.

Cesar Daniel
  • 707
  • 1
  • 9
  • 25
  • Have a look at https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/configure-language-version. If VS 2017 is mentioning "Visual Basic 12.0", it may be an issue with the LangVersion setting (of .vbproj). – rskar Jul 25 '18 at 00:17
  • Or since this about an old site, maybe more appropriate is https://stackoverflow.com/questions/45773322/multiline-string-not-work-in-vb-net-module. (It's about the same problem but with VS 2015 - might still be applicable.) – rskar Jul 25 '18 at 00:35
  • Thanks. But the "ASP.NET Empty Web Site" template project "does not produce a project file and has limited MSBuild support". I'll try your second suggestion. – Cesar Daniel Jul 25 '18 at 00:47
  • @CesarDaniel I know it's a bit late, but here's a related bug report where Microsoft has decided this is _not_ a bug: https://developercommunity.visualstudio.com/content/problem/99154/error-bc36716-visual-basic-120-does-not-support-in.html – Der Kommissar Jan 03 '19 at 20:35

1 Answers1

4

This is what I did to fix the problem:

  1. Install the "Microsoft.CodeDom.Providers.DotNetCompilerPlatform" NuGet package.
  2. Restart Visual Studio.

Thanks @rskar for the link.

Cesar Daniel
  • 707
  • 1
  • 9
  • 25