locked
MVC 4 Package installation Error in VS 2010 RRS feed

  • Question

  • I have just installed MVC 4 for VS 2010 and now I am facing issues while creating any project for MVC 4.

    I am getting Package Installation Error:

    Could not add all the required packages to the project. The following packages failed to install from 'C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 4\Packages'

    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.

    Please help if anyone has faced any similar issues.

    Thanks in advance.

    Wednesday, August 29, 2012 2:21 PM

Answers

  • The issue solved for me by deleting the reference of Entity Framework and adding the dll from 'C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 4\Packages\EntityFramework.5.0.0\lib\net40' location.

    But everytime I create a new project in MVC 4 i will have to do this. This is just a work-around which I am doing for now.

    But any ideas what could have gone wrong??

    • Marked as answer by sh_sh Thursday, August 30, 2012 7:45 AM
    Thursday, August 30, 2012 7:45 AM

All replies

  • The issue solved for me by deleting the reference of Entity Framework and adding the dll from 'C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 4\Packages\EntityFramework.5.0.0\lib\net40' location.

    But everytime I create a new project in MVC 4 i will have to do this. This is just a work-around which I am doing for now.

    But any ideas what could have gone wrong??

    • Marked as answer by sh_sh Thursday, August 30, 2012 7:45 AM
    Thursday, August 30, 2012 7:45 AM
  • Hi sh_sh,

    Glad to have you have found a solution.

    For related issue, I recommend you post your question here:

    http://forums.asp.net/1146.aspx/1?MVC

    It is because MVC 4 is a additional package for Visual Studio 2010

    http://www.asp.net/mvc/mvc4

    Thanks,


    Barry Wang [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, August 30, 2012 7:52 AM
  • Hi Guys,

    It got resolved for me after installing the Windows powershell 2.0.

    Info: http://www.microsoft.com/en-in/download/details.aspx?id=9864

    Download Link: http://www.microsoft.com/en-in/download/confirmation.aspx?id=9864


    Thursday, October 11, 2012 6:49 AM
  • It can be solved by adding Reference to the project:

    1. Right click References on the Solution Explore of the project and click Add Reference
    2. Click Browse and select EntityFramework.dll from Look in (C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 4\Packages\EntityFramework.5.0.0\lib\net40)
    3. Click OK close

    After adding the reference, the problems will be solved.

    Friday, June 7, 2013 3:28 PM
  • Please read the security implications first, but to avoid the error on a development machine, open PowerShell as admin and run the following:

    Set-ExecutionPolicy AllSigned

    Again, make sure you understand security implications!

    -D

    Sunday, January 12, 2014 7:15 PM
  • Set-ExecutionPolicy Unrestricted

    It fixed my problem, after following this http://patrickdesjardins.com/blog/failed-to-initialize-the-powershell-host


    Luo Zhijian

    Tuesday, May 13, 2014 2:23 PM
  • That's useful Thanks!! :)
    Friday, September 2, 2016 5:36 AM