ProjectRenamer
ProjectRenamer copied to clipboard
Renameproject should report errors caused by locked files or folders in a manner understandable by the user
Get message "Do you want to continue with the rename operation? [Enter=Yes, any other key=No]" at renameproject. Nothing happens then, PMC got unresponsive, tried to wait few minutes. Need to restart VS to back to be operational. VS 2019, ver. 16.9.6 - latest as of today.
Also, would be really great to have the utility as VS extension instead of package. We really need it :)
re getting stuck: I need more info.
However, VS should notice only if files were changed - which is odd because you are saying there is no further output after you press <Enter> on the prompt. I would try and have VS closed while running renamer. Or just make sure no instance has the solution or projects within open.
re VS extension: I'm afraid that's too far out-of-scope for me, sorry
FYI - I can confirm this gets 'stuck' when running from package manager console. Stuck meaning it never does the next step
Analyzing references in your projects - depending on the number of projects this can take a bit...
after hitting Enter=yes.
No keys seem to work. You can abort by pressing the X (cancel) in PM console title bar which returns the message The pipeline has been stopped.
I had better progress from Developer Powershell (on Windows) but still failed as in my case it doesn't seem to like relative folders in project references?
UPDATE: my failure was occurring because I had the project folder open in a separate Explorer window which was 'locking' the folder rename.
Yes, right. The reason why renamer got stuck is file locking. It was unclear what was keeping them locked. The same applies to the ProjectRenamer itself - I was unable to remove it with uninstall command. Finally accomplished removal by rebooting machine and renamed my project manually.
May be you can add a check if some files are locked and display a warning to a user.
Interesting, I never thought of people using the package manager console because I personally use a Windows Terminal configured with PowerShell.Core.
Anyway, @nikriaz proposal to check for locking makes sense and I'll add that when I got a little time.