Access to path is denied for writing feature.*
Closed this issue · 8 comments
Hey everyone, I'm on my work laptop and trying to execute the initial setup for pickles. However, I'm sure there is some security policy preventing the command to execute:
Something went wrong during generation: System.UnauthorizedAccessException: Access to the path 'C:\pathtofeatures\features.docx' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.IO.Abstractions.FileWrapper.Create(String path)
at PicklesDoc.Pickles.DocumentationBuilders.Word.WordDocumentationBuilder.Build(Tree features)
at PicklesDoc.Pickles.Runner.Run(IContainer container) Access to the path 'C:\GeneratedDocs\features.docx' is denied.
Pickles did not complete successfully Access to the path 'C:\pathtofeatures\features.docx' is denied.
Is there any other way to execute to generate these files?
Hi,
One question first: do you perhaps have that file open in Word? Word blocks access to the files it's working on.
If not: you could try generating the file to a different path - for example a location where you can save Word files using Word.
Thanks for the quick reply, unfortunately, no word isn't open. I've even gone as far as restarting the machine and not having anything open. I've also tried to change the file path and launch with the most elevated privileges we get. I got with our desktop support and had them run as admin, and same error. I know this is likely environmental here, but just didn't know if there were any alternatives. We're using SpecFlow with Gherkin and NUnit. Do you think if I used the Pickles.MSBuild it'd help? Or is it just executing the same command under the hood?
All 4 runners basically run the same command under the hood ... you could try one of the other runners (like the MSBuild runner) but I'm not optimistic :-(
Thanks again for the quick replies, I'm about to close this out. After experimenting with some PowerShell scripting, I was able to get it to work. Cheers
I'm glad you got it to work!
Thanks! I was getting a little worried too, as this looks promising. Do you guys have a forum type platform for questions?
No, this is the only forum for questions.
I’m afraid I will be off-line for the next week and a half, so I won’t be able to answer other questions.
But by all means, give Pickles a good spin, and if you notice anything that can be improved, feel free to create a ticket - or even better a pull request ;-)
Sounds great! I just mainly didn't want to clutter your stuff.