Using relative path for “Start external program” in VS.NET 2010

后端 未结 7 1111
独厮守ぢ
独厮守ぢ 2020-12-13 04:13

I\'ve seen a few posts related to this topic but none with any conclusive answers...

When debugging my VS.NET 2010 app, I\'m trying to start an external program whos

7条回答
  •  伪装坚强ぢ
    2020-12-13 04:26

    Found the answer here.

    In the event that the above link goes dead, the summarized answer is as follows:

    1. Macros don't work here, so forget about that.
    2. Environment variables don't work either, so forget about that as well.
    3. It turns out that Visual Studio.NET (at least 2008 and 2010) uses one of two paths as the base for any relative path specified in the Start external program setting...

    If Visual Studio.NET was launched by clicking on the SLN file in Explorer, the base path will be the folder (including the "\") where the SLN resides. Once I modified my relative path to account this and then launched VS.NET 2010 by double-clicking the SLN file, my external program correctly launched when hitting F5.

    If Visual Studio.NET was launched from the shortcut on the Start Menu and then the SLN was opened from within Visual Studio.NET, the base path will be [Visual Studio install path]\Microsoft Visual Studio ["9.0" or "10.0" depending on whether using VS.NET 2008 or 2010]\Common7\IDE\.

    I guess it makes sense now, but it still kinda stinks that VS.NET will only find my external program correctly depending on how I launch VS.NET.

提交回复
热议问题