打开VS2017时打包管理器控制台错误 [英] Package Manager Console error on opening VS2017
问题描述
打开VS 2017时出现以下错误。
加载扩展类型数据文件时出现以下错误:Microsoft.PowerShell .Core,C:\ Windows \ SysWOW64 \ WindowsPowerShell \v1.0 \ type.ps1xml(3007):类型为"System.Security.AccessControl.ObjectSecurity"时出错:异常:
getter方法应该是public,non void,static,并且有一个PSObject类型的参数。
我将Visual Studio升级到版本15.6,将PowerShell升级到版本6.1并尝试在以下链接中找到的解决方案 。
< 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"公钥=" 31bf3856ad364e35" />
< publisherPolicy apply =" no" />
< / dependentAssembly>
< dependentAssembly>
< assemblyIdentity name =" Microsoft.PowerShell.Security"公钥=" 31bf3856ad364e35" />
< publisherPolicy apply =" no" />
< / dependentAssembly>
< dependentAssembly>
< assemblyIdentity name =" Microsoft.PowerShell.Commands.Diagnostics"公钥=" 31bf3856ad364e35" />
< publisherPolicy apply =" no" />
< / dependentAssembly>
< / assemblyBinding>
< / runtime>
如果以上方法无法帮助您,请修复您的Visual Studio Enterprise 2017,然后再次测试。
问候,
Judyzh
I have been getting the following error when opening VS 2017.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(3007) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
I upgraded Visual Studio to version 15.6, upgraded PowerShell to version 6.1 and tried the solution found at the following link PMC open error
I can't get anything to work. Certainly others must be experiencing this behavior.
Thomas Donino Visual Studio 2010 on Windows 7
Hi dinotom,
Welcome to the MSDN forum.
Do you meet the issue when opening VS2017 after upgraded it? Is this works fine before upgrade the VS2017?
Please try to open Manage NuGet Package UI from Project -> Manage NuGet Packages, if the Manager UI could be opened correctly, the NuGet Packages Manager should be fine. The issue should be related to the PowerShell.
Please remove the PowerShell package from Visual Studio and delete "%AppData%\Microsoft\VisualStudio", check the result.
Otherwise, the issue is caused by the NuGet Packages Manager.
1.Please uninstall and reinstall your NuGet Package Manager for Visual Studio 2017. You could open Visual Studio Installer, remove the NuGet package manager from Individual components list.
2. Please add the suggestion items to the VS exe config file, refer to similar thread in stack overflow.
<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>
If above methods could not help you, please repair your Visual Studio Enterprise 2017, and test again.
Regards,
Judyzh
这篇关于打开VS2017时打包管理器控制台错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!