CppAst.NET
CppAst.NET copied to clipboard
CppParser.ParseFiles() functions differently when run during a pre-build event in VS19, but works normally elsewhere
I am developing a small preprocessor for a game engine that I am working on with some friends, and we are using CppAST.Net in the preprocessor to autogenerate some files for runtime reflection.
The development of the preprocessor was going well, until I tried to run it during a pre-build event in visual studio where it wouldn't parse all of the files that I gave it. When run from the debugger or from a local published version of the application the program generates the AST in 30-40 seconds, finds 19 classes, 4 of which have the reflectable attribute, and generates 4 files for each of those classes (16 in total). But when the application is run during a pre-build event it only takes 5-6 seconds, finds 8 classes (non of which are reflectable) and generates no files.
I have been testing and debugging for the last week and I am completely at a loss. If anyone has any ideas on what this could be any help would be appreciated.
Some of my suspicions that I have yet to be able to prove/disprove is that the VS19 build output cmd prompt may have some different env variables that prevent certain functions from being called or are blocking certain .Net libraries. I have also checked my output, and there are no errors to be found.
I will be posting logs, and screenshots a little later
Successful Run from this .bat file
Log:
Output.txt
Failed run from the pre-build event
using these arguments
Log
Output.txt
Are you checking/outputing that the result of parsing doesn't have any error or messages? (e.g compilation.Diagnostics.HasErrors and compilation.Diagnostics.Messages)
yep, my program outputs errors to the log, and prints that the ast generation failed in the console