title: Roslyn VB.Net Specify Compiler Version
body: <p>I am trying to compile a VB program using the code below, the code requires VB 15.5 and even when I specify LanguageVersion.Latest or LanguageVersion.VisualBasic15_5, I still get error ERR_ExpectedNamedArgument - Named argument expected. Please use language version 15.5 or greater to use non-trailing named arguments. Some code was removed to simplify example.</p>
  
  <pre><code>    Public Function CompileVisualBasicString(StringToBeCompiler As String,  SeverityToReport As DiagnosticSeverity, ByRef ResultOfConversion As ConversionResult) As EmitResult
      If StringToBeCompiler.IsEmptyNullOrWhitespace Then
          ResultOfConversion.FilteredListOfFailures = New List(Of Diagnostic)
          ResultOfConversion.Success = True
          Return Nothing
      End If
      Dim syntaxTree As SyntaxTree = VisualBasicSyntaxTree.ParseText(StringToBeCompiler)
      Dim assemblyName As String = Path.GetRandomFileName()
  
      Dim PreprocessorSymbols As New Dictionary(Of String, Object) From {
          {"NETSTANDARD2_0", Nothing}
      }
  
      Dim ParseOptions As VisualBasicParseOptions = New VisualBasicParseOptions(
              languageVersion:=LanguageVersion.Latest,
              documentationMode:=DocumentationMode.Diagnose,
              kind:=SourceCodeKind.Regular,
              preprocessorSymbols:=PreprocessorSymbols)
  
      Dim CompilationOptions As VisualBasicCompilationOptions = New VisualBasicCompilationOptions(
                                                                          outputKind:=OutputKind.DynamicallyLinkedLibrary,
                                                                          optionExplicit:=False,
                                                                          optionInfer:=True,
                                                                          optionStrict:=OptionStrict.Off,
                                                                          parseOptions:=ParseOptions
                                                                          )
      Dim compilation As VisualBasicCompilation = VisualBasicCompilation.Create(
                                                                  assemblyName:=assemblyName,
                                                                  syntaxTrees:={syntaxTree},
                                                                  references:=References,
                                                                  options:=CompilationOptions
                                                                                )
  
      Dim CompileResult As EmitResult
      Using ms As MemoryStream = New MemoryStream()
          CompileResult = compilation.Emit(ms)
      End Using
      Return CompileResult
  End Function
  </code></pre>