WeihanLi / dotnet-exec

dotnet execute with custom entry point, another dotnet run without project file
https://weihanli.github.io/dotnet-exec/
Apache License 2.0
45 stars 5 forks source link

privileged operation issue #11

Closed WeihanLi closed 10 months ago

WeihanLi commented 11 months ago
dotnet-exec 'File.CreateSymbolicLink(@"C:\Users\weihan.li\.kube\config", @"C:\Users\weihan.li\.kube\paralus-nonprod.yaml")'
fail: dotnet-exec[0]
      Execute code exception
      System.IO.IOException: A required privilege is not held by the client. : 'C:\Users\weihan.li\.kube\config'
         at Interop.Kernel32.CreateSymbolicLink(String symlinkFileName, String targetFileName, Boolean isDirectory)
         at System.IO.File.CreateSymbolicLink(String path, String pathToTarget)
         at Submission#1.<<Initialize>>d__0.MoveNext()
      --- End of stack trace from previous location ---
         at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.RunSubmissionsAsync[TResult](ImmutableArray`1 precedingExecutors, Func`2 currentExecutor, StrongBox`1 exceptionHolderOpt, Func`2 catchExceptionOpt, CancellationToken cancellationToken)
         at Microsoft.CodeAnalysis.Scripting.Script`1.RunSubmissionsAsync(ScriptExecutionState executionState, ImmutableArray`1 precedingExecutors, Func`2 currentExecutor, Func`2 catchExceptionOpt, CancellationToken cancellationToken)
         at Microsoft.CodeAnalysis.Scripting.ScriptStateTaskExtensions.CastAsync[S,T](Task`1 task)
         at Exec.Services.CSharpScriptCompilerExecutor.Execute(CompileResult compileResult, ExecOptions options) in /_/src/dotnet-exec/Services/CSharpScriptingExecutor.cs:line 49
         at Exec.CommandHandler.Execute(ExecOptions options) in /_/src/dotnet-exec/CommandHandler.cs:line 92
WeihanLi commented 10 months ago

image

https://github.com/dotnet/runtime/issues/69470

WeihanLi commented 10 months ago

verified that it's the OS user permission issue, not related to the tool or .NET image