Lex Eichner
Lex Eichner

Reputation: 1066

VS error when creating new WebAPI project

When I create a new WebAPI project (MVC4) I get the following error.

EntityFramework.5.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.7.1.1: 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.

After Googling I have found a few answers but nothing that works yet.

Error creating new MVC project - EF and JQuery This answer seems like it should work for me as my last project was a 7z Command Line app and I might have done something daft with 7zip. But I copy pasted the 7-Zip directory from Program Files to Program Files (86) with no luck.

http://social.msdn.microsoft.com/Forums/en-US/vssetup/thread/c934fed4-e44e-4a06-9e3b-eccb9c8aa8d6 There is an answer here that might work (I haven't tried it) but even if it does work I wouldnt want to do this every time I create a new project.

Is anyone able to help me with this one?

Upvotes: 3

Views: 1352

Answers (2)

Thomas Mueller
Thomas Mueller

Reputation: 4199

I got around a similar error by running PowerShell as administrator with the command Set-ExecutionPolicy Unrestricted, restarting Visual Studio, and opening the Package Manager Console before what I wanted to do.

Make sure you understand the security implications of doing this first.

http://technet.microsoft.com/en-us/library/ee176961.aspx

  • Restricted - No scripts can be run. Windows PowerShell can be used only in interactive mode.
  • AllSigned - Only scripts signed by a trusted publisher can be run.
  • RemoteSigned - Downloaded scripts must be signed by a trusted publisher before they can be run.
  • Unrestricted - No restrictions; all Windows PowerShell scripts can be run.

Upvotes: 1

牛さん
牛さん

Reputation: 3006

I encountered this issue recently, after re-install VS and install the latest VS update 2, things go well. This works for me at least.

Upvotes: 0

Related Questions