首页 > 解决方案 > Visual Studio For Mac 无法使用 Nuget 包管理扩展运行 Powershell

问题描述

我试图在 Visual Studio for Mac 版本 8.4.8(VS Mac)的包管理控制台中使用 add-migration 命令。但是,包管理(PM)控制台不随 VS Mac 一起提供。 在 Visual Studio for mac 中找不到包管理器控制台 我按照上面的链接安装了 Powershell 和 NuGet 包管理扩展版本 0.21 。PM 控制台出现在我的 VS Mac 中。但是当我打开它时,它开始给我错误,我粘贴在下面。

我可以在 mac 终端中运行 PowerShell。但它在 VS Mac 中不起作用

Disconnected from remote PowerShell host. Reason: Disposed: Reached end of stream.
Disconnected from remote PowerShell host. Reason: Disposed: Reached end of stream.
Unable to restart PowerShell host
Unable to restart PowerShell host
A task was canceled.
NuGet 5.3.0.3
Type 'get-help NuGet' for more information.

Unable to restart PowerShell host
PM> 
Unable to restart PowerShell host
PM> 
Unable to restart PowerShell host
PM> 
Unable to restart PowerShell host

'/Users/myname/.nuget/packages/microsoft.entityframeworkcore.tools/3.1.2/tools/init.ps1'

Executing script file '/Users/myname/.nuget/packages/microsoft.entityframeworkcore.tools/3.1.2/tools/init.ps1'...
Write fault on path /[Unknown]
Disconnected from remote PowerShell host. Reason: Disposed: Reached end of stream.

标签: macospowershellvisual-studio-macnuget-package-manager-console

解决方案


感谢大家的关注。

今天我的VS Mac无法打开我之前的项目文件并显示这个错误

Expected 1 export(s) with contract name MonoDevelop.TextEditor.CocoaTextViewImports but found 0 after applying applicable constraints.

我认为我对这个问题的一些调试过程导致了这个新问题。所以我决定重新安装我的VS。我卸载了 VS Mac,所有资源和依赖文件都按照这个链接

仅从应用程序文件夹中删除 VS Mac 是不够的。

安装 NuGet 包管理扩展后,我的 PM 控制台显示没有任何错误,新问题也消失了。


推荐阅读