简体   繁体   English

aspnet与visual studio代码恢复包

[英]aspnet with visual studio code restoring packages

So I've decided to give it a go and try visual studio code and c# development on my mac. 所以我决定试试看我的mac上的visual studio代码和c#开发。

The setup is annoying, but I can live with that. 设置很烦人,但我可以忍受。 Now I'm running into 2 specific issues that prevent me from even getting through the HelloWorld steps... 现在我遇到了两个阻止我完成HelloWorld步骤的具体问题......

1) I used yo aspnet to create the project from the given templates. 1)我使用yo aspnet从给定的模板创建项目。 It then tells you to run dnu restore which works fine, for the most part until I run into the following issue: 然后它会告诉你运行dnu restore ,它运行正常,直到我遇到以下问题:

Installing Microsoft.Extensions.Configuration.UserSecrets.1.0.0-rc1-final System.UnauthorizedAccessException: Access to the path '/Users/lostballoon/.dnx/packages/Microsoft.Extensions.Configuration.UserSecrets/1.0.0-rc1-final' is denied. 安装Microsoft.Extensions.Configuration.UserSecrets.1.0.0-rc1-final System.UnauthorizedAccessException:访问路径'/Users/lostballoon/.dnx/packages/Microsoft.Extensions.Configuration.UserSecrets/1.0.0-rc1-final ' 被拒绝。

Why only this package? 为什么只有这个包? Why not the ones before this? 为什么不在此前呢? And Why am I getting this? 为什么我得到这个?

I run into this same issue even when trying to restore the packages of an EmptyApplication : 即使在尝试恢复EmptyApplication的包时,我也会遇到同样的问题:

Installing Microsoft.AspNet.IISPlatformHandler.1.0.0-rc1-final System.UnauthorizedAccessException: Access to the path '/Users/lostballoon/.dnx/packages/Microsoft.AspNet.IISPlatformHandler/1.0.0-rc1-final' is denied. 安装Microsoft.AspNet.IISPlatformHandler.1.0.0-rc1-final System.UnauthorizedAccessException:拒绝访问路径'/Users/lostballoon/.dnx/packages/Microsoft.AspNet.IISPlatformHandler/1.0.0-rc1-final'。 at System.IO.UnixFileSystem.CreateDirectory(String fullPath) at System.IO.Directory.CreateDirectory(String path) System.IO.Directory.CreateDirectory上的System.IO.UnixFileSystem.CreateDirectory(String fullPath)(字符串路径)

2) In VSCode, when choosing dnx: Run Command or dnx: Restore Packages I get a warning pop-up that says the following: 2)在VSCode中,当选择dnx: Run Commanddnx: Restore Packages我会收到一条警告弹出窗口,其中显示以下内容:

OmniSharp server is not running. OmniSharp服务器未运行。

I have no clue what is wrong and how to get it working. 我不知道出了什么问题以及如何让它发挥作用。

I ran into this same issue when installing things today. 我今天安装时遇到了同样的问题。 I got similar errors when it tried to install things to: 我尝试安装以下内容时遇到类似的错误:

/Users/yourname/.dnx/packages/ /Users/yourname/.dnx/packages/

What I did was open Terminal, change directory to /Users/yourname/, and then run (replacing "yourname" with your username): 我做的是打开终端,将目录更改为/ Users / yourname /,然后运行(用您的用户名替换“yourname”):

sudo chown -R 'yourname' .dnx sudo chown -R'wourname'.dnx

That gives you ownership of that folder, so that you can then change directory to .dnx and create the 'packages' folder (mkdir packages within .dnx folder). 这使您拥有该文件夹的所有权,以便您可以将目录更改为.dnx并创建'packages'文件夹(.dnx文件夹中的mkdir包)。 Once I made that 'packages' folder I was able to then restore. 一旦我制作了'packages'文件夹,我就可以恢复了。

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

相关问题 VIsual Studio 2022 卡在恢复 Nuget 包上 - VIsual Studio 2022 stuck on Restoring Nuget packages 在Visual Studio 2015解决方案中恢复所有Nuget包 - Restoring all Nuget Packages in a Visual Studio 2015 Solution 如何在Visual Studio代码上调试AspNet 5应用程序? - How to debug AspNet 5 app on Visual Studio Code? Visual Studio 2019 for Mac:还原或添加 Nuget 包时出错 - Visual Studio 2019 for Mac: Error when restoring or adding Nuget packages 在Visual Studio Code中还原依赖关系使用了错误的源/提要 - Restoring dependencies in Visual Studio Code is using the wrong source/feed 如何从Visual Studio中下载的包中查看源代码 - How to view the source code from downloaded packages in Visual Studio Visual Studio 2017代码编译,但nuget包是红色下划线 - Visual Studio 2017 code compiles, but nuget packages are red underlined 将框架/NuGet 包的源代码添加到 Visual Studio - Add source code for frameworks/NuGet packages to Visual Studio 从Visual Studio Code中的NPM包自动导入 - Auto Import from NPM packages in Visual Studio Code 打开项目时 Visual Studio 代码中出现“无法恢复包” - "Could not restore packages" in Visual Studio code when opening a project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM