How can I find out the value of $(ProjectDir)?

前端 未结 6 555
囚心锁ツ
囚心锁ツ 2020-12-07 18:04

Where can I execute and find out the value of $(ProjectDir)?

相关标签:
6条回答
  • 2020-12-07 18:39

    The answer from slugster did not work for me (most possible my fault).

    In Visual Studio 2008

    1. right click on your project in the Solution Explorer, select Properties
    2. Go to Configuration Properties and then to Debugging
    3. Click on the arrow in the Command Field and click the Edit Button
    4. In Edit clik "Macros>>" You will see there the values of ProjectDir... etc..
    0 讨论(0)
  • 2020-12-07 18:41

    Do a pre/post build step.

    Example:

    echo $(ProjectDir)
    
    0 讨论(0)
  • 2020-12-07 18:49

    Open the project properties (Alter+Enter) and then go to "Build Events", select any of the build events, then select "Command Line", click "Edit", then press the "Macros >>" button.

    0 讨论(0)
  • 2020-12-07 18:56

    To find out what it is right now (rather than at build time, where it may be different depending on what is going on):

    • right click on your project in the Solution Explorer, select Properties
    • select the Build Events tab
    • click the Edit pre-build or Edit post-build button, either is fine
    • in the window that pops up, click the Macros button
    • scroll down the list till you find ProjectDir, in the next pane is its actual value
    0 讨论(0)
  • 2020-12-07 19:01

    In Visual Studio 2015, you can find ProjectDir by clicking on Macros in additional Include Directories and then clicking on Macros (for me there was nothing in Build Events) :

    0 讨论(0)
  • 2020-12-07 19:06

    For me it was the path to the directory containing *.vcxproj file.

    From http://msdn.microsoft.com/en-us/library/c02as0cs%28v=vs.80%29.aspx:

    The directory of the project (defined as drive + path); includes the trailing backslash '\'.

    0 讨论(0)
提交回复
热议问题