t5 icon indicating copy to clipboard operation
t5 copied to clipboard

Template using VB fails with compilation errors

Open Echo-8-ERA opened this issue 6 years ago • 1 comments

Trying to use the following template:

<#@ template language="VB" #>
<#@ output extension=".txt" #>
Hello World

Results in:

PS C:\T4Test> dotnet tt Test.tt
Processing 'Test.tt' failed.
(0,15): ERROR ; expected
(0,56): ERROR ; expected
(1,76): ERROR Syntax error, '(' expected
(3,21): ERROR Syntax error, ',' expected
(3,43): ERROR Syntax error, ',' expected
(3,44): ERROR Tuple must contain at least two elements.
(3,49): ERROR Syntax error, ',' expected
(4,10): ERROR Syntax error, ',' expected
(4,11): ERROR Syntax error, ',' expected
(4,33): ERROR Identifier expected
(4,42): ERROR Syntax error, ',' expected
(6,9): ERROR Preprocessor directive expected
(7,16): ERROR Identifier expected
(7,16): ERROR Syntax error, ',' expected
(7,17): ERROR Type expected
(7,17): ERROR Tuple must contain at least two elements.
(7,17): ERROR ) expected
(7,17): ERROR Identifier expected
(7,17): ERROR Syntax error, ',' expected
(7,31): ERROR Syntax error, ',' expected
(7,64): ERROR Identifier expected
(7,64): ERROR Syntax error, ',' expected
(7,65): ERROR Type expected
(7,65): ERROR Tuple must contain at least two elements.
(7,65): ERROR ) expected
(7,65): ERROR Identifier expected
(7,65): ERROR Syntax error, ',' expected
(7,68): ERROR ; expected
(7,106): ERROR ; expected
(7,106): ERROR Member definition, statement, or end-of-file expected
(9,9): ERROR Preprocessor directive expected
(10,48): ERROR Syntax error, '(' expected
(11,16): ERROR Syntax error, ',' expected
(13,21): ERROR Syntax error, ',' expected
(13,35): ERROR Syntax error, ',' expected
(13,36): ERROR Tuple must contain at least two elements.
(14,14): ERROR Syntax error, ',' expected
(14,15): ERROR Syntax error, ',' expected
(15,8): ERROR Syntax error, ',' expected
(16,4): ERROR Syntax error, ',' expected
(16,9): ERROR Identifier expected
(16,9): ERROR Syntax error, ',' expected
(18,6): ERROR Syntax error, ',' expected
(18,42): ERROR Tuple must contain at least two elements.
(18,43): ERROR Identifier expected
(18,43): ERROR ) expected
(18,43): ERROR ; expected

Changing the language to C# makes it work as expected.

Echo-8-ERA avatar May 06 '18 13:05 Echo-8-ERA

I'm afraid that Roslyn does not support Visual Basic scripting (see dotnet/roslyn#13523) at the moment so not much can be done about it before that gets addressed.

atifaziz avatar May 07 '18 07:05 atifaziz