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
I try to create a DLL that contains a Lexer and Parser generated by Antlr4 and that will work with .NET Core.
For this, I followed the guide to setup VS 2017 to use Antlr4. I created a new .Net Core class library project and added Antlr 4.6.6 via NuGet package manager.
However, when building the project (i.e. generating the Lexer and Parser), I get a bunch of build errors since the Antlr4 namespace cannot be resolved in the generated files.
I found this old issue and when I add explicit PackageReferences to the Antrl runtime, the generated cs files can be compiled fine.
Is it still the recommended way to manually add the PackageReference to the CSPROJ file, or is there a better way?
Also, in the mentioned issue, the CodeGenerator is also manually added as a PackageReference. At least I don't need it to rid myself of the build errors, but maybe I still need it later?
Hello,
I try to create a DLL that contains a Lexer and Parser generated by Antlr4 and that will work with .NET Core.
For this, I followed the guide to setup VS 2017 to use Antlr4. I created a new .Net Core class library project and added Antlr 4.6.6 via NuGet package manager.
However, when building the project (i.e. generating the Lexer and Parser), I get a bunch of build errors since the Antlr4 namespace cannot be resolved in the generated files.
I found this old issue and when I add explicit PackageReferences to the Antrl runtime, the generated cs files can be compiled fine.
<PackageReference Include="Antlr4.Runtime" Version="4.6.6" />
Is it still the recommended way to manually add the PackageReference to the CSPROJ file, or is there a better way?
Also, in the mentioned issue, the CodeGenerator is also manually added as a PackageReference. At least I don't need it to rid myself of the build errors, but maybe I still need it later?
<PackageReference Include="Antlr4.CodeGenerator" Version="4.6.6" PrivateAssets="all" />
Any help is appreciated.
The text was updated successfully, but these errors were encountered: