WorkingDirectory in .gitignore?

This forum is meant for anything you would like to share with other visitors
Post Reply
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

WorkingDirectory in .gitignore?

Post by ic2 »

Frank and I use a different working directory. Every time I pull his changes, I have to change in project properties, Debug, Working Directory.

That also means that a next pull will fail because this single change leads to a dozen or so "uncommitted changes" which I have to stash every time to enable me to pull Frank's changes. With the risk that if I change something which wasn't committed that I lose it for Frank to use. Or the risk that I commit all and Frank has to change his working directory.

We know that in the .xsproj <DebuggerWorkingDirectory> is where the directory is stored. However, if we add the project file in .gitignore, important changes like references are not exchanged either.

Is there a solution for this (apart from using the same working directory which has other disadvantages)?

Dick
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

WorkingDirectory in .gitignore?

Post by robert »

Dick,
The workingdirectory properties also supports macros such as $(Solutiondir) and also $(EnvironmentVariable)
Can you use one of these ?
I see that newer versions of the C# project system store the debugger options in a separate file, separated from the project file. I'll see if we can do that too.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

WorkingDirectory in .gitignore?

Post by ic2 »

Hello Robert,

Adding $(MyWorkDir) after creating that environmental variable works, thanks!

Remarkable is that it doesn't show up in the list of $ options when you press the ... key in Project/Debug, also not after a VS restart. But it works and that's what counts. So separating the debugger settings might be a good idea but for me it won't have high priority.

Dick
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

WorkingDirectory in .gitignore?

Post by robert »

Dick,
We could include all environment variables there, but there is no guarantee that on another machine the environment variable exists. That is why we did not do that.
The fact that this works is "magic" inside MsBuild

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply