What is an easy way to access prebuild macros, such as $ (SolutionDir) and $ (DevEnvDir), from C # code?

Now I'm going to write the file paths in the pre-build event, and then read from this file in the code, but I wonder if there is a more elegant way.

edit: It’s kind of like Help with one step to create all projects + installer (.NET + WiX) , since I really didn’t get an answer to this, seeing if I can get an answer to a simpler question.

+3
source share
2 answers

Here is a dirty hack: dump them into a file.

  • Add an action to the pre-build events to display the solution path to the file:

    echo $(SolutionDir) > SolutionDirFile.txt

  • SolutionDirFile.txt #.

+8

, , - - PostSharp. , - , .

0

Source: https://habr.com/ru/post/1702261/


All Articles