次の情報は、このVisual StudioのNuGetコンソールバグレポートのチケットのスレッドから収集したhttps://github.com/NuGet/Home/issues/1638
原因Yishai Galatzer(マイクロソフト)からthis commentパー
、問題は、スタックオーバーフローのバグによって引き起こされますSystem.Management.Automation 3.0の一部であるPowerShell DLLに含まれています。バグのある更新されたDLLは、過去数週間のうちにWindows Updateの一部として配布されたようです。
また、Yishai Galatzerのanother commentによると、今月後半(2016年1月)にPowerShellチームが修正をリリースする予定です。
回避策/一時的な解決策
"pete1208" posted以前、同じスレッドで以下の回避策:お使いのVisual Studioフォルダに
は、ファイルdevenv.exe.config
のバックアップコピーを作成します。
<!-- WORKAROUND START for NuGet Console error:
"The type initializer for 'System.Management.Automation.Runspaces.InitialSessionState' threw an exception"
Author: pete1208 from https://github.com/NuGet/Home/issues/1638 -->
<dependentAssembly>
<assemblyIdentity name="System.Management.Automation" publicKeyToken="31bf3856ad364e35" />
<publisherPolicy apply="no" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.PowerShell.Commands.Utility" publicKeyToken="31bf3856ad364e35" />
<publisherPolicy apply="no" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.PowerShell.ConsoleHost" publicKeyToken="31bf3856ad364e35" />
<publisherPolicy apply="no" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.PowerShell.Commands.Management" publicKeyToken="31bf3856ad364e35" />
<publisherPolicy apply="no" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.PowerShell.Security" publicKeyToken="31bf3856ad364e35" />
<publisherPolicy apply="no" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.PowerShell.Commands.Diagnostics" publicKeyToken="31bf3856ad364e35" />
<publisherPolicy apply="no" />
</dependentAssembly>
<!-- WORKAROUND END -->
は(おそらくにお好みのテキストエディタの管理者-上昇したバージョンが必要になります:
その後、元devenv.exe.configファイルで、次のようちょうど開封後assemblyBinding
要素を挿入ファイルをVisual Studioフォルダに保存します)。
その後、Visual Studioを再起動します。
再度per Yishai Galatzer、この回避策の効果は、バインディングリダイレクトを使用してPowerShell 1.0を強制的に読み込むことです。
私は回避策を試しましたが、それは私のために働いた。私のVisual Studio 2013のMy Package Manager Consoleがもう一度機能します。
NuGetのバグスレッドに注目し、System.Management.Automationの修正プログラムを適用したWindows Updateが公開されたことをお知らせしたら、私の回避策を取り戻すつもりですdevenv.exe.config
ファイル。
更新
修正がYishai Galatzer(マイクロソフト)ごとに、January 12, 2016 Windows Updateにリリースされました。
あなたは[ここ](https://github.com/NuGet/Home/issues/1638)で提案されているものが関連しているかどうか試してみることができます。それ以外の場合は、Visual Studioで[ActivityLog](https://msdn.microsoft.com/library/ms241272.aspx)を作成します。これには通常、エラーに関する技術情報が含まれています。 –
私は同じ問題を抱えていましたが、Visual Studioを再起動してしまいました。Visual Studio Community 2013を使用しています。 – Dev