I am trying to develop a solution which would analyze both C# and VisualBasic, of course with appropriate branches in the code for the two languages.
Initially I got the "language not supported" for both languages. Eventually I found an answer for C# which solved the problem for this particular language. The answer can be found at
Roslyn throws The language 'C#' is not supported
The resolution was very simple, just adding
var _ = typeof(Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions);
to my code. Apparently this makes MSBuild aware that the Microsoft.CodeAnalysis.CSharp.Workspaces is needed and as a result it loads it.
I have tried to find something similar for VisualBasic, but I was not able to find anything. I have tried, for example
var _v2 = typeof(Microsoft.CodeAnalysis.VisualBasic.VisualBasicCompilation);
... but that did not help.
Is there a solution for VisualBasic similar to that of C#?