Waypoint icon indicating copy to clipboard operation
Waypoint copied to clipboard

Cant build or load projects when not running terminal/IDE as administrator

Open kMutagene opened this issue 5 years ago • 1 comments

Describe the bug Trying to build a clean template generated with dotnet new waypoint and running dotnet fake build (after dotnet tool restore) i get the following error when running in a non-elevated shell. Everything works fine in an elevated shell.


There was a problem while setting up the environment:
-> symlink C:\Users\kevin\.nuget\packages\microsoft.netcore.targets\3.1.0 -> C:\Users\kevin\source\repos\WaypointTest2\packages\docs\Microsoft.NETCore.Targets failed with error : [1] with output :
    and error : You do not have sufficient privilege to perform this operation.
   StackTrace:
        at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1637.Invoke(String message) in E:\A\_work\130\s\src\fsharp\FSharp.Core\printf.fs:line 1637
        at SymlinkUtils.makeDirectoryLink(String target, String source)
        at [email protected](String _arg17)
        at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation`1 ctxt, FSharpFunc`2 userCode, b result1) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 417
        at <StartupCode$FSharp-Core>[email protected](AsyncActivation`1 ctxt) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 1066
        at <StartupCode$FSharp-Core>[email protected](AsyncActivation`1 ctxt) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 1066
        at [email protected](AsyncActivation`1 ctxt) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 589
        at [email protected](AsyncActivation`1 ctxt) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 589
        at [email protected](AsyncActivation`1 ctxt) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 589
        at [email protected](AsyncActivation`1 ctxt) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 589
        at [email protected](AsyncActivation`1 ctxt) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 589
        at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 109
     --- End of stack trace from previous location where exception was thrown ---
        at Microsoft.FSharp.Control.AsyncResult`1.Commit() in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 349
        at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronouslyInCurrentThread[a](CancellationToken cancellationToken, FSharpAsync`1 computation) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 870
        at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronously[T](CancellationToken cancellationToken, FSharpAsync`1 computation, FSharpOption`1 timeout) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 890
        at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 1151
        at [email protected](Unit unitVar0)
        at Paket.Utils.RunInLockedAccessMode[a](String lockedFolder, FSharpFunc`2 action)
        at Paket.RestoreProcess.Restore(String dependenciesFileName, RestoreProjectOptions projectFile, Boolean force, FSharpOption`1 group, Boolean ignoreChecks, Boolean failOnChecks, FSharpOption`1 targetFrameworks, FSharpOption`1 outputPath, Boolean skipRestoreTargetsExtraction)
        at Fake.Runtime.FakeRuntime.paketCachingProvider(FakeConfig config, String cacheDir, Dependencies paketApi, Lazy`1 paketDependenciesFile, FSharpOption`1 group) in D:\a\1\s\src\app\Fake.Runtime\FakeRuntime.fs:line 345
        at Fake.Runtime.FakeRuntime.runScript(PrepareInfo preparedScript) in D:\a\1\s\src\app\Fake.Runtime\FakeRuntime.fs:line 596
        at Program.runOrBuild(RunArguments args) in D:\a\1\s\src\app\Fake.netcore\Program.fs:line 156

Ionide fails to load the projects as well when run in non-elevated VSCode (i guess this is because it tries to run dotnet restore?). It works here aswell when running vscode elevated.

image

To Reproduce Steps to reproduce the behaviour:

  1. install latest waypoint template (dotnet new -i waypoint)
  2. create clean new template (dotnet new waypoint)
  3. open in non-elevated vscode
  4. dotnet tool restore and then dotnet fake build in non elevated shell

Expected behaviour project builds and can be loaded in vscode

Environment (please complete the following information):

  • OS: Windows 10 Pro 1909 18363.836
  • Ionide version: 4.11.0
  • VSCode version: 1.45.1 (user setup)
  • dotnet SDK version: 3.1.201

kMutagene avatar May 20 '20 08:05 kMutagene

This is bit surprising - I'm not running Code or my terminal in elevated mode usually.

As a workaround in paket.dependencies file change line with storage: symlink to the storage: packages

Krzysztof-Cieslak avatar May 25 '20 11:05 Krzysztof-Cieslak