You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
..\Reference\Antlr\Antlr3.targets (126)#0: Unknown build error: : error 10 : internal error: {my grammar file}.g3 : System.InvalidCastException: Unable to cast object of type 'Antlr3.Targets.CSharp3Target' to type 'Antlr3.Codegen.Target'. at Antlr3.Codegen.CodeGenerator.LoadLanguageTarget(String language, String targetsDirectory) in j:\dev\github\sharwell\antlrcs\Antlr3\Codegen\CodeGenerator.cs:line 358 at Antlr3.Tool.Grammar..ctor(AntlrTool tool, String fileName, CompositeGrammar composite) in j:\dev\github\sharwell\antlrcs\Antlr3\Tool\Grammar.cs:line 585 at Antlr3.AntlrTool.GetRootGrammar(String grammarFileName) in j:\dev\github\sharwell\antlrcs\Antlr3\AntlrTool.cs:line 776 at Antlr3.AntlrTool.Process() in j:\dev\github\sharwell\antlrcs\Antlr3\AntlrTool.cs:line 624 LoadLanguageTarget at offset 344 in file:line:column j:\dev\github\sharwell\antlrcs\Antlr3\Codegen\CodeGenerator.cs:358:21 .ctor at offset 932 in file:line:column j:\dev\github\sharwell\antlrcs\Antlr3\Tool\Grammar.cs:585:13 GetRootGrammar at offset 59 in file:line:column j:\dev\github\sharwell\antlrcs\Antlr3\AntlrTool.cs:776:13 Process at offset 398 in file:line:column j:\dev\github\sharwell\antlrcs\Antlr3\AntlrTool.cs:624:21
If a solution contains multiple projects that contain ANTLR grammars, then compiling the two at the same time (at VS command prompt or via NCrunch) can lead to such exceptions. There would be no exception when compiling in VS, as VS seems to use another way to build solution.
In CI systems, it is usually only MSBuild that builds the solutions. Thus, this issue is really annoying.
A workaround is to manually build the ANTLR projects one by one, and later the solution.
Can find a similar report and detailed analysis in http://forum.ncrunch.net/yaf_postst921_Intermittent-build-error-with-ANTLR-3.aspx
If a solution contains multiple projects that contain ANTLR grammars, then compiling the two at the same time (at VS command prompt or via NCrunch) can lead to such exceptions. There would be no exception when compiling in VS, as VS seems to use another way to build solution.
In CI systems, it is usually only MSBuild that builds the solutions. Thus, this issue is really annoying.
A workaround is to manually build the ANTLR projects one by one, and later the solution.
The text was updated successfully, but these errors were encountered: