Z
Z
Zakharov Alexander2018-09-03 15:51:33
visual studio
Zakharov Alexander, 2018-09-03 15:51:33

Visual Studio 2017 plugin automatically generates additional files in C#. How does VS find them?

Hello. Plugin
name antlr4 (parser generator for formats and languages). But the point is not in it. To work with antlr4, a descriptive *.g4 (text) file is required, with a description of the grammar, on the basis of which VS generates additional *.cs files (when the .g4 file is changed, these files are regenerated), which are added to the project\obj\Debug directory : Additionally, properties are specified for the .g4 file (these properties are specified in the plugin installation documentation):
5b8d28b42568e565109101.png
5b8d2c6262718428800805.png
I did not additionally indicate to include these * .cs files in the project, but VS sees them during assembly and in IntellySense. The first thought is that it was not possible to find them or a link to a directory with these files in the project files. Obviously I don't understand the structure of the .csproj file well and would therefore like to understand how VS "does this"?
PS
Just in case, here are the links that appeared in the project file after installing the antlr4 plugin: Update: What are the obj and bin folders (created by Visual Studio) used for? https://stackoverflow.com/questions/5308491/what-a...
5b8d2e39f3d10909239399.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rayvor, 2018-09-03
@AlexZaharow

Well, as I see it, it defines its custom Build Action, which is described in the files Antlr4.CodeGenerator.targets/Antlr4.CodeGenerator.props
Then it generates files and puts them in obj/Debug from where they are all compiled into the assembly

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question