[英]Unable to run solution after build in Visual Studio for Mac and Asp.net Core 2.0 Web API
I was a bit tired of my slow running pc, which has Visual Studio 2017. So, I shifted my code of Mac where I have Visual Studio 2017 for Mac, after restoring dependencies it built properly, but when running, it gives the exception below: 我对运行缓慢的PC(装有Visual Studio 2017)感到有点厌倦。因此,在恢复正确构建的依赖关系后,我将Mac的代码转移到装有Visual Studio 2017 for Mac的Mac上,但是在运行时,出现以下异常:
Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking.UvException has been thrown
error -13 EACCES permission denied
So, I tried to run dotnet from terminal to find the root cause of the error with this: 因此,我尝试从终端运行dotnet来查找此错误的根本原因:
dotnet run
Now, I it throws exception as below: 现在,我抛出如下异常:
Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[48] Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider [48]
An error occurred while reading the key ring.
System.UnauthorizedAccessException: Access to the path '/Users/apple/.aspnet/DataProtection-Keys/42cb81a7-89b6-4a29-86ae-76d3acca3076.tmp' is denied. ---> System.IO.IOException: Permission denied
So, this is the error where permission is required to access this path, so what I tried is this: 因此,这是需要权限才能访问此路径的错误,因此我尝试了以下操作:
sudo dotnet run
Which is running perfectly. 哪个运行完美。
Now the question is, how can I run this within Visual Studio Mac? 现在的问题是,如何在Visual Studio Mac中运行它? I need to debug and walkthrough the code many times.
我需要多次调试和遍历代码。
在终端中运行以下命令:这将以Admin特权打开Visual Studio,其工作方式类似于charm。
sudo /Applications/Visual\ Studio.app/Contents/MacOS/VisualStudio
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.