build - generated files from ANTLR conflict in visual studio between release and debug modes -
i use antlr4
visual studio
, c#
. during build process antlr4
tool generates 6 c#
source files (i.e parser, lexer, visitor, listener etc) correspond parser antlr
generates. files generated in obj/debug directory of project (assuming debug mode chosen). add these files links in solution explorer inspecting generated code.
if try change release mode antlr4
generates same files in obj/release directory of project , these files in conflict (dublicate classes in same namespace) files produced in obj/debug directory.
the question is:
when in release mode having done aforementioned actions, there way exclude generated files in solution explorer debug mode (while on release mode) or have manually exclude obj/debug directory solution explorer in order avoid conflict?
thanks in advance
i struggled on same problem. main problem, have linked files projects debug configuration. links still there when switch release configuration , have duplicate definitions in project. visibles in obj/debug path , invisibles in obj/release path
i don't know solution solve on vs-gui. possible patch cproj file acceptable solution:
first orginal part:
... <itemgroup> <compile include="datarepository.cs" /> <compile include="spreadsheeterrorlistener.cs" /> <compile include="spreadsheetvisitor.cs" /> <compile include="program.cs" /> <compile include="properties\assemblyinfo.cs" /> <compile include="obj\debug\spreadsheetbaselistener.cs" /> <compile include="obj\debug\spreadsheetbasevisitor.cs" /> <compile include="obj\debug\spreadsheetlexer.cs" /> <compile include="obj\debug\spreadsheetlistener.cs" /> <compile include="obj\debug\spreadsheetparser.cs" /> <compile include="obj\debug\spreadsheetvisitor.cs" /> </itemgroup> ...
yours should similar.
i splitted itemgroups this:
... <itemgroup> <compile include="datarepository.cs" /> <compile include="spreadsheeterrorlistener.cs" /> <compile include="spreadsheetvisitor.cs" /> <compile include="program.cs" /> <compile include="properties\assemblyinfo.cs" /> </itemgroup> <itemgroup condition=" '$(configuration)|$(platform)' == 'release|anycpu' "> <compile include="obj\release\spreadsheetbaselistener.cs" /> <compile include="obj\release\spreadsheetbasevisitor.cs" /> <compile include="obj\release\spreadsheetlexer.cs" /> <compile include="obj\release\spreadsheetlistener.cs" /> <compile include="obj\release\spreadsheetparser.cs" /> <compile include="obj\release\spreadsheetvisitor.cs" /> </itemgroup> <itemgroup condition=" '$(configuration)|$(platform)' == 'debug|anycpu' "> <compile include="obj\debug\spreadsheetbaselistener.cs" /> <compile include="obj\debug\spreadsheetbasevisitor.cs" /> <compile include="obj\debug\spreadsheetlexer.cs" /> <compile include="obj\debug\spreadsheetlistener.cs" /> <compile include="obj\debug\spreadsheetparser.cs" /> <compile include="obj\debug\spreadsheetvisitor.cs" /> </itemgroup> ...
in vs both directories visible, 1 used intellisense , during compile.
the selected files shown "openers" (sorry don't know correct name)
doesn't nice solves problem.
the disadvantage:
every time add new configurations must patch cproj file again. worth way, cause intellisense, resharper , other nice little helper work.
Comments
Post a Comment