Open BananchickPasha opened 5 years ago
Do you have write permission as your user to the project folder?
Can you try that in a separate project in a different location on the machine?
I have the same error at different location (~/dotnet) and don't have this error with old 2.2 sdk:
> dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 2.2.401
Commit: 729b316c13
Runtime Environment:
OS Name: nixos
OS Version: 19.09.736.9bbad4c6254
OS Platform: Linux
RID: linux-x64
Base Path: /nix/store/v5dw1mbw3y1ia8ybv9jyhp04kr4lx936-dotnet-sdk-2.2.401/sdk/2.2.401/
Host (useful for support):
Version: 2.2.6
Commit: 7dac9b1b51
.NET Core SDKs installed:
2.2.401 [/nix/store/v5dw1mbw3y1ia8ybv9jyhp04kr4lx936-dotnet-sdk-2.2.401/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.6 [/nix/store/v5dw1mbw3y1ia8ybv9jyhp04kr4lx936-dotnet-sdk-2.2.401/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.6 [/nix/store/v5dw1mbw3y1ia8ybv9jyhp04kr4lx936-dotnet-sdk-2.2.401/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.6 [/nix/store/v5dw1mbw3y1ia8ybv9jyhp04kr4lx936-dotnet-sdk-2.2.401/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
This is likely a duplicate of https://github.com/dotnet/core-setup/issues/8511, about to be fixed by https://github.com/dotnet/core-setup/pull/8510 TL;DR the app host is copied from the global install location which may not include writable permissions and thus the task that modifies the app host fails.
I even set 777 permissions both for dotnet installation and project dirs, but it didn't help, I have the same error.
You are using nix, I find there are many restrictions from nix and we are not familiar with it. We would need some time to investigate
I'm seeing a similar problem in macOS + Nix. Version 2.2 works without problem. I'm new to .Net, but maybe I'm able to help fixing it. As detailed in the StackOverflow question my hypothesis is that I need access to some path outside the Nix store but setting $TMPDIR
doesn't work, neither does $DOTNET_BUNDLE_EXTRACT_BASE_DIR
I am having a similar problem, running dotnet run
gives me
/usr/local/share/dotnet/sdk/3.1.201/Microsoft.Common.CurrentVersion.targets(2081,5): warning MSB3101: Could not write state file "obj/Debug/netcoreapp3.1/try-argu.fsprojAssemblyReference.cache". Access to the path '/Users/btl787/00-local/01-programming/04-fsharp/08-argu/try-argu/obj/Debug/netcoreapp3.1/try-argu.fsprojAssemblyReference.cache' is denied. [/Users/btl787/00-local/01-programming/04-fsharp/08-argu/try-argu/try-argu.fsproj]
/usr/local/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.GenerateAssemblyInfo.targets(116,5): error MSB3491: Could not write lines to file "obj/Debug/netcoreapp3.1/try-argu.AssemblyInfoInputs.cache". Access to the path '/Users/btl787/00-local/01-programming/04-fsharp/08-argu/try-argu/obj/Debug/netcoreapp3.1/try-argu.AssemblyInfoInputs.cache' is denied. [/Users/btl787/00-local/01-programming/04-fsharp/08-argu/try-argu/try-argu.fsproj]
/usr/local/share/dotnet/sdk/3.1.201/Microsoft.Common.CurrentVersion.targets(5199,5): error MSB3491: Could not write lines to file "obj/Debug/netcoreapp3.1/try-argu.fsproj.FileListAbsolute.txt". Access to the path '/Users/btl787/00-local/01-programming/04-fsharp/08-argu/try-argu/obj/Debug/netcoreapp3.1/try-argu.fsproj.FileListAbsolute.txt' is denied. [/Users/btl787/00-local/01-programming/04-fsharp/08-argu/try-argu/try-argu.fsproj]
The build failed. Fix the build errors and run again.
while sudo dotnet run
has no errors and prints "Hello World".
I have the same issue with Ubuntu 18.04.5
and dotnet core 3.1.100
Same issue Ubuntu 20.04 - Core 3.1.403 (error MSB4018: ---> System.IO.IOException: Permission denied
...)
Using chmod 777 or chown to current user on entire repo doesn't help. But is giving "Permission denied" to files within the repo still?
Sudo dotnet build
works though... But this means that I cannot use my IDE on Linux for much of anything really...
.NET Core SDK (reflecting any global.json):
Version: 3.1.403
Commit: 9e895200cd
Runtime Environment:
OS Name: pop
OS Version: 20.04
OS Platform: Linux
RID: linux-x64
Base Path: /usr/share/dotnet/sdk/3.1.403/
Host (useful for support):
Version: 3.1.9
Commit: 774fc3d6a9
.NET Core SDKs installed:
3.1.403 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.9 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Only way I can make it work is by doing chmod 775
to repo + /usr/share but I don't want to instruct other consumers of this code to be doing things like that...
Does this qualify as a bug for ASP.NET core on linux? Or is this not supposed to be happening? If so what is the thing that I'm doing wrong? (I've tried the package manager + snap + the microsoft install script but all have the same issue)
Same issue here with WSL2 + ubuntu 20.04
, 5.0 SDK installed like https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#2004- instructed.
sudo works.
The scripted install worked for me https://docs.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install
For those who are running windows on a processor more than 1 core, probably will experience it in WSL2.
I solved just setting the processors=1
in .wslconfig.
When i write
dotnet build
in any project, I have this error:but when I run the same command under root, all works OK:
Another problem is that when I write
sudo dotnet run
, It cannot find some filesWhat can it be? Here is my dotnet info: