Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

efpt.postrun.cmd no longer defaults to project folder #2406

Closed
rustygutter opened this issue Jun 17, 2024 · 2 comments
Closed

efpt.postrun.cmd no longer defaults to project folder #2406

rustygutter opened this issue Jun 17, 2024 · 2 comments
Labels
question Further information is requested

Comments

@rustygutter
Copy link

For reasons I cannot determine, my "efpt.postrun.cmd" is no longer running correctly. Or to be more accurate, it runs, but the line that calls my powershell script now fails because the script is now run with a default folder of 'C:\WINDOWS\system32' rather than the project folder.

For many months, my "efpt.postrun.cmd" file contained the following line:
pwsh -File .\TrackingManager\Db\_UpdateDbJsonTypes.ps1

the relative path was always found and my script ran without issue.
But recently that stopped working.
I was able to get things working only by updating the line to contain the full path:
pwsh -File C:\Users\ted.barham\source\repos\TrackingManager\TrackingManager\Db\_UpdateDbJsonTypes.ps1

But this is not a solution as the full path is only valid on my machine, so it will never work on other developer machines.

Any idea why efpt.postrun.cmd is now defaulting to 'C:\WINDOWS\system32' rather than the project folder? Is there a 'switch' in efpt somewhere that I might have messed-up?

I have looked through the GIT history of my project files and I can't find anything that would seem to be responsible.

I am running VS 2022 Version 17.10.2.
I have updated Visual Studio recently, and maybe that's the root of my problem? (but wouldn't other people have reported it?)

@ErikEJ
Copy link
Owner

ErikEJ commented Jun 18, 2024

I could be a VS change or some extension changing the working directory.

I think you can use something like this in your cmd file to make it more robust:

SET curDir=%~dp0
PUSHD %curDir%

@rustygutter
Copy link
Author

rustygutter commented Jun 18, 2024 via email

@ErikEJ ErikEJ closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2024
@ErikEJ ErikEJ added the question Further information is requested label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants