Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kMutagene opened this issue May 20, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@kMutagene
Copy link
Contributor

kMutagene commented May 20, 2020

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
@Krzysztof-Cieslak
Copy link
Member

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 Krzysztof-Cieslak added the bug Something isn't working label May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants