1

If I do string interpolation like so:

Dim answer as integer = 42
Dim fred as string = $"the answer is {answer}"

It works if I do it in a VB file, but if I do it in an ASPX file, I get this error:

BC30037: Character is not valid.

How do I enable string interpolation in ASPX files?

ekolis
  • 6,270
  • 12
  • 50
  • 101
  • You did not specify the VS version (or any other). Maybe this applies: [Strange ASP.Net Error: .net 4.6.1, VS2015 - interpolated strings not supported?](https://stackoverflow.com/q/35127022/7444103) – Jimi Jan 23 '20 at 15:47
  • The Visual Studio version is 2019. I'm getting a different error from that other question, so I'm not sure if it's the same issue. – ekolis Jan 23 '20 at 16:05
  • Try this: https://stackoverflow.com/questions/31548699/how-to-use-c-sharp-6-with-web-site-project-type – mxmissile Jan 23 '20 at 16:18
  • I can't even use LINQ; if I add an import statement at the top of the page e.g. `<%@ Import Namespace="System.Linq" %>` I still get compile errors on LINQ methods... – ekolis Jan 29 '20 at 16:35

0 Answers0