Does a C# preprocessing tool exist?

前端 未结 5 1538
南旧
南旧 2021-01-05 11:27

Does anyone know of a utility to preprocess a C# source file without compiling it, in a similar fashion to using the -E flag in GCC? I tried using GCC - it successfully proc

5条回答
  •  一个人的身影
    2021-01-05 11:48

    I do not believe that there are any flags for the csc or msc (mono compiler) to output the preprocessed files.

    If I had to do this, and it was a small subset I would compile and then use Reflector to decompile back to C# and export the files. If you have a lot of files, there is an Reflector Add-In called FileGenerator for Reflector.

    Unfortunately this will not be a true copy of your codebase -- it will reformat all of the code and you will lose all of the comments.

提交回复
热议问题