pdevito3 / craftsman

A .NET scaffolding tool to help you stop worrying about boilerplate and focus on your business logic 🚀
https://wrapt.dev
MIT License
1.12k stars 65 forks source link

Windows Explorer issue #101

Closed amalsharief closed 1 year ago

amalsharief commented 1 year ago

Hi Paul,

Thank you for the brilliant work. Working on Windows 10 Pro. Craftsman 0.17. I am facing the same problem I mentioned last time, it was with the craftsman's file AddUserFeatureOverrideModifier.cs where you are deleteing AddUser.cs file and replacing it with AddUser.cstemp.
File.Move(tempPath, classPath.FullClassPath); The program will raise an exception "The process cannot access the file because it is being used by another process." The problem was that the file AddUser.cstemp is still used by the Windows Explorer (Process Explorer shows that) when you are renaming it by
File.Move(tempPath, classPath.FullClassPath); To solve the problem I have had to close the file first by calling

// delete the old file and set the name of the new one to the original name File.Delete(classPath.FullClassPath);
output.Close();
File.Move(tempPath, classPath.FullClassPath);

Could you kindly investigate the problem.

Best regards,

Amalsharief

pdevito3 commented 1 year ago

hey, thanks for reporting this with the details and keeping me honest! i've still never been able to repro this myself, but i see a likely culprit in some lingering tech debt i missed. will get a pre-release patch up soon for you to try.

pdevito3 commented 1 year ago

@amalsharief i just published 17.1 which I'm hoping fixes things. going to repoen this to track it but let me know one way or another if you don't mind (i still can't repro myself)!

amalsharief commented 1 year ago

Craftsman 0.17 result No problem with the same configuration using CentOS 7 Thanks,

image

image