views:

72

answers:

2

I am developing a ClassLibrary-Project in Visual Studio 2008. I want something to check. I have file 'index.html' in root of my project. I need set StartAction to open this file with some browser. I found StartAction in "Project Properties->Debug->Start Action". I can choose "Start external program" or "Start browser with URL", but they require absolute path to my file. I want to do it with relative path (like '$(ProjectDir)index.html'). How I can do it?

+1  A: 

Unfortunately none of the Visual Studio Macros are replaceable in the Debug "Start External Program" menu. It also appears that relative paths are considered from the location of devenv.exe. I don't know if that's 100% true but it appears to be through experimentation.

I think your best bet at this point is to hard code the path. The path is stored in the user specific project file and is typically a machine specific file. The majority of Source Code Control providers don't check this in by default for that reason so you won't mess up other devs.

JaredPar
A: 

The relative path is different depending on how you start visual studio. If you start it from the Visual Studio icon, then the relative path is considered from the location of devenv. If you start it by double clicking on the solution file, then the relative path is considered from teh location of your solution file.

However none of these are good enough to solve this problem :(

Paul