Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to access SolutionDir from post build event in bamboo?

JeffreyM August 10, 2015

Does anyone know how to access Solution Variables such as "$SolutionDir" from VS in bamboo? You cannot define a custom variable in bamboo = to SolutionDir so I am stuck. Any ideas please.

2 answers

0 votes
JeffreyM August 11, 2015

What I am attempting is to get the value to $(SolutionDir) from the post build event that is defined in the .csproj file. What happens is that when the post build steps goes to run in bamboo the $(SolutionDir) is not defined so when bamboo tries to use that variable it has no value so it actually substitutes an extra ../ to the path and the .file that is trying to be copied is not found.

Since Bamboo only allows alphanumeric variables I cannot predefine $(SolutionDir) in bamboo which should be changed in my opinion. As a result the build fails and reports an unsuccessful status. I know I can modify the .csproj file but that defeats the purpose of the $(SolutionDir).

0 votes
Mike Friedrich
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 10, 2015

The variable itself cannot be used in bamboo, but you can hardcode the solutiondir by using the workspace directory and the relative file of you sln. Or you can define a bamboo variable and use that as a environment variabe. VS allows you to use environment variables with the $() syntax.

Mike Friedrich
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 10, 2015

But please explain why you need that. Maybe there is another way of achieving the same.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events