2017-02-16 8 views
1

私はwebアプリケーションプロジェクトを作成しようとしていたとき、私は以下のようなメッセージが表示され、このエラーに直面しています:OKをクリックした後、それはプロジェクトの作成を続行しますが、私が持っている最後のステップになり、Visual Studioパッケージのインストールエラー:「PowerShellホストの初期化に失敗しました。

Package Installation Error

Could not add all required packages to the project. Thw following packages failed to install from 'C:\Program Files (x86)\Michrosoft Web Tools\Packages':

Microsoft.Web.Infrastructure.1.0.0.0: Failed to initialize the PowerShell host. If your PowerShell execution policy setting is set to AllSigned, open the Package Manager Console to initialize the host first.
jQuery.1.10.2: Failed to initialize the PowerShell host. If your PowerShell execution policy setting is set to AllSigned, open the Package Manager Console to initialize the host first.
Modernizr.2.6.2: Failed to initialize the PowerShell host. If your PowerShell execution policy setting is set to AllSigned, open the Package Manager Console to initialize the host first.
Newtonsoft.Json.6.0.4: Failed to initialize the PowerShell host. If your PowerShell execution policy setting is set to AllSigned, open the Package Manager Console to initialize the host first.

もまた、このエラーメッセージ:すべての後に

Failed to initialize the PowerShell host. If your PowerShell execution policy setting is set to AllSigned, open the Package Manager Console to initialize the host first.

、パッケージマネージャコンソールで、私はこの奇妙なメッセージが表示されています:

An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

+0

"Set-ExecutionPolicy AllSigned"でPowerShellで修正しようとしましたが、何も起こりませんでした。 –

答えて

3

実行ポリシーをRemoteSignedまたはUnrestrictedに設定すると機能するはずです。 PowerShellコンソールを使用して管理者モードで変更する必要があります。変更はPowerShellコンソールのビットバージョンに応じて適用されるので、32ビットまたは64ビットに注意してください。したがって、特定のポリシーを必要とするVisual Studio(32ビット版)にパッケージをインストールする場合は、PowerShell(x86)経由でポリシーの設定を変更する必要があります。

PowerShellのコマンド(管理者など)(コメントで@Gabrielで述べたように)無制限にポリシーを設定するには、次のとおりです。

start-job { Set-ExecutionPolicy Unrestricted } -RunAs32 | wait-job | Receive-Job 

無制限にポリシーを設定した、あなたが設定したいでしょうインストールが完了した後、元のポリシーに戻ります。

+0

申し訳ありませんが、私には同じエラーが表示されます。 –

+0

マシンを再起動しましたか? –

+0

はい、もちろんです。 –

1

再インストール - >管理者としてプログラムを実行する - >ラップトップ/デスクトップをインターネットに接続して、アップデートやダウンロード可能なファイルを入手します。

+0

私はそれが動作しない前に試しました。 –

+0

インストーラはお使いのオペレーティングシステムに対応していますか? (windows 32bitまたは64bit?) 他のデバイスに使ってみましたか? – ZZZ

関連する問題