简体   繁体   English

在Visual Studio for Mac和Asp.net Core 2.0 Web API中生成后无法运行解决方案

[英]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. 我需要多次调试和遍历代码。

Try to enable Root User Account . 尝试启用“ 根用户帐户”

This link may be helpful, though. 不过,此链接可能会有所帮助。

在终端中运行以下命令:这将以Admin特权打开Visual Studio,其工作方式类似于charm。

sudo /Applications/Visual\ Studio.app/Contents/MacOS/VisualStudio

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 具有多个ASP.NET Web应用程序的Visual Studio解决方案 - Visual Studio solution with multiple ASP.NET web applications 无法在Mac的Visual Studio Code中运行默认的ASP.NET Web App - Cant Run Default ASP.NET Web App In Visual Studio Code for Mac 如何使用 ASP.NET 核心 web 应用程序托管 web 页面? - How can I host web pages with an ASP.NET Core web application - API project in Visual Studio? 更改 xml 输出路径后,ASP.NET Core Web API 解决方案空间充满了许多文件 - ASP.NET Core web API solution space filled with many files after changing xml output path ASP.NET Core 2.0 Web API IIS 托管和调试 - ASP.NET Core 2.0 Web API IIS Hosting and Debugging Web.Api 2和Asp.Net核心在一个解决方案中 - Web.Api 2 and Asp.Net core in one solution 如何在不使用 Visual Studio 的情况下直接在 Dockers 容器上运行 ASP.NET Core Web 应用程序 - How to run an ASP.NET Core Web Application on Dockers container directly without using Visual Studio 如何在visual studio上运行asp.net core mvc项目? - How to run asp.net core mvc project on visual studio? 从Visual Studio 2017运行ASP.NET Core项目 - Run ASP.NET Core Project from Visual Studio 2017 Asp.net 2.0和Visual Studio 2005的Asp.Net Web框架 - Asp.Net Web Framework for Asp.net 2.0 and Visual Studio 2005
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM