44

When I'm trying to open any solutions that worked fine before in Visual Studio 2012, the error "Package 'Visual C++ package' failed to load" keeps showing up. And the solution can't be opened.

I'm not sure what's wrong with my Visual Studio 2012 installation.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user1964417
  • 1,675
  • 4
  • 17
  • 26
  • See also: http://stackoverflow.com/questions/36114464/visual-studio-2015-community-visual-c-project-system-package-error – idbrii Sep 02 '16 at 17:30

4 Answers4

75
  1. click the TOOLS--->VISUAL STUDIO COMMAND PROMPT to open the command window
  2. input the command "devenv /Setup"
  3. open the visual studio 2012 again, it will works.

Source: http://happyivyli.blogspot.com/2013/07/visual-c-package-failed-to-load.html

flayn
  • 5,272
  • 4
  • 48
  • 69
user1964417
  • 1,675
  • 4
  • 17
  • 26
  • 2
    I was just about to reinstall VS2012, great find! – EJA Jul 26 '13 at 16:02
  • 1
    after typing devenv /Setup it just sits there no error no nothing – code4jhon May 22 '15 at 16:17
  • 3
    This worked for me despite showing an error message ("not authorized" or something). Restarted Visual Studio afterward, and then it worked. – Josh1billion Oct 17 '15 at 03:32
  • 2
    For anyone like me who can't find the VS Command Prompt in VS2013, it's in `C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts` – Tharwen Jan 02 '16 at 21:59
7

Running command prompt from inside Visual Studio.

For easier access, you can add the Visual Studio Developer Command Prompt or any other command prompt to the Tools menu on Visual Studio, by adding it to the external tools list. This is how you can accomplish that:

  1. Open Visual Studio.

  2. Select the Tools menu and choose External Tools...

  3. On the External Tools dialog box, choose the Add button. A new entry appears.

  4. Enter a Title for your new menu item such as Command Prompt.

  5. In the Command field, specify the file you want to launch such as %comspec% or C:\Windows\System32\cmd.exe.

  6. In the Arguments field, specify where to find the specific command prompt you want to use such as /k "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat" (this will launch the Developer Command Prompt installed with Visual Studio 2015). This value needs to be changed according to your Visual Studio version and installation location.

  7. Choose a value for the Initial directory field such as Project Directory.

  8. Choose the OK button. After that, the new menu item is added and you can access the command prompt from the Tools menu.

Then:

  1. Right-click the Visual Studio icon
  2. Choose Run As Administrator
  3. Click the menu TOOLS → *Command Prompt** to open the command window
  4. Input the command "devenv /Setup"
  5. Open Visual Studio again, and it will work.
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Yurker
  • 77
  • 1
  • 4
4

None of the solutions I found around, including those listed here, seemed to help. What did work was going in the software install/uninstall management, right clicking on Visual Studio and choosing "change" (that's where you would normally uninstall something from).

That should pop up the Visual Studio package manager, and from there you can choose repair.

In my case, looking at the systems backlog and restore points, it seems it was one of the Visual C++ redistributables, possibly installed by some game, that compromised the environment.

This is on Windows 8.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
3

Possibly same fix as this https://stackoverflow.com/a/21266545/990618

Check your User environment variables for VCHOME, VCINSTALLDIR and vsinstalldir.

Change

X:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\

to

X:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\

Or

X:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\

depending VS 2012 or 2013.

Community
  • 1
  • 1
colin lamarre
  • 1,714
  • 1
  • 18
  • 25