How can we help you today? How can we help you today?

What permissions are required on custom snippets folder?

Failed to import snippets from SSMS: Error: Unhandled exception: System.UnauthorizedAccessException: Access to the path 'C:\MyFolder\SQLPrompt\Snippets' is denied.
   at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
   at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.IO.File.Open(String path, FileMode mode)
   at RedGate.SqlPrompt.SnippetConverter.Ads.AdsSnippets.Save(String snippetsFile, IEnumerable`1 snippets) in "D:\BuildAgentA\work\dc5fefc0dc183d00\SnippetConverter\Ads\AdsSnippets.cs":line 25
   at RedGate.SqlPrompt.SnippetConverter.SsmsToAdsSnippetConverter.Convert(String ssmsSnippetsFolder, String adsSnippetsFile) in "D:\BuildAgentA\work\dc5fefc0dc183d00\SnippetConverter\SsmsToAdsSnippetConverter.cs":line 32
   at RedGate.SqlPrompt.SnippetConverter.Program.Run(Logger logger, String ssmsSnippetsLocation, String adsSnippetsLocation) in "D:\BuildAgentA\work\dc5fefc0dc183d00\SnippetConverter\Program.cs":line 77
   at RedGate.SqlPrompt.SnippetConverter.Program.<>c__DisplayClass1_0.<Main>b__0(String ssmsSnippetsFolder, String adsSnippetsFile) in "D:\BuildAgentA\work\dc5fefc0dc183d00\SnippetConverter\Program.cs":line 36
   at System.CommandLine.Handler.<>c__DisplayClass2_0`2.<SetHandler>b__0(InvocationContext context)
   at System.CommandLine.Invocation.AnonymousCommandHandler.<>c__DisplayClass2_0.<.ctor>g__Handle|0(InvocationContext context)
   at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass15_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass26_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass24_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__23_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass21_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__8_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__7_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseExceptionHandler>b__0>d.MoveNext()

ThomasH
0

Comments

3 comments

  • ATurner
    Hi Thomas
    Could you try adding AzureData studio to my trusted controlled folder access and setting the folder to be a 'shared folder' in settings "allow an app through controlled folder access" 
    ATurner
    0
  • ThomasH
    Hi
    The setting is controlled by company policy and unfortunately I cannot make any changes.

    ThomasH
    0
  • ThomasH
    I have tried setting the appth to the default setting '..\AppData\Local\Red Gate\SQL Prompt 10\Snippets', but access is denied on the default folder as well.
    ThomasH
    0

Add comment

Please sign in to leave a comment.