程序包管理器控制台无法运行Visual Studio 2013

时间:2015-02-25 20:17:35

标签: visual-studio-2013 nuget

这是我打开它时得到的,之前有人遇到过这个问题吗?从未发生在我身上:

Could not find file 'C:\Windows\SysWOW64\WindowsPowerShell\v1.0\typesv3.ps1xml'.
Could not find file 'C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Event.Format.ps1xml'.
Could not find file 'C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Event.Format.ps1xml'.

更新:将这些条目添加到devenv.config后,我得到:

There were errors in loading the format data file: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\EXTENSIONS\AUEN3JAD.VIJ\Modules\NuGet\NuGet.Format.ps1xml, Error in file C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\EXTENSIONS\AUEN3JAD.VIJ\Modules\NuGet\NuGet.Format.ps1xml: '', hexadecimal value 0x13, is an invalid character. Line 311, position 36.
There were errors in loading the format data file: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\EXTENSIONS\AUEN3JAD.VIJ\Modules\NuGet\NuGet.Format.ps1xml, Error in file C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\EXTENSIONS\AUEN3JAD.VIJ\Modules\NuGet\NuGet.Format.ps1xml: '', hexadecimal value 0x13, is an invalid character. Line 311, position 36.

3 个答案:

答案 0 :(得分:3)

尝试将这些行添加到运行时部分中的devenv.exe.config文件中。它可能有用。

 <runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <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>
    </assemblyBinding>
</runtime>

答案 1 :(得分:2)

要执行此操作,请单击“开始”,在“搜索”框中键入“命令提示符”或“cmd”,右键单击“命令提示符”,然后单击“以管理员身份运行”。如果系统提示您输入管理员密码或进行确认,请键入密码,或单击“允许”。enter image description here

类型命令
C:\ windows \ system32&gt; sfc / scannow

答案 2 :(得分:0)

添加上面指出的行适用于VS2013,但后来我对VS2015有同样的问题,并且它在那里不起作用。有效的是Ed Vowles在这里的评论:https://github.com/NuGet/Home/issues/2836

“我能够通过从https://www.microsoft.com/en-us/download/details.aspx?id=50395安装(或重新安装)PowerShell来解决此问题(为我的Windows 7计算机选择此版本:Win7AndW2K8R2-KB3134760-x64.msu)并重新启动。”