[英]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 Command
或dnx: 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.