Visual Studio Enterprise 2017中的程序包管理器控制台错误 [英] Package Manager Console Errors in Visual Studio Enterprise 2017

查看:64
本文介绍了Visual Studio Enterprise 2017中的程序包管理器控制台错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法进行nuget恢复。 我在Package Manager控制台中收到一堆错误,但我无法输入任何命令。 以下是错误:


加载扩展类型数据文件时出现以下错误:Microsoft.PowerShell.Core,C:\ Windows \ SysWOW64 \ WindowsPowerShell \v1.0 \types.ps1xml(32):类型为"System.Xml.XmlNode"的错误:异常:无法创建代码方法,因为
的方法格式。该方法应该是public,static,并且有一个类型为PSObject的参数。

加载扩展类型数据文件时发生以下错误:Microsoft.PowerShell.Core,C:\ Windows \ SysWOW64 \ WindowsPowerShell \v1.0 \types.ps1xml(44):类型为"System.Xml.XmlNodeList"的错误:异常:无法创建代码方法,因为
的方法格式。该方法应该是public,static,并且有一个类型为PSObject的参数。

加载扩展类型数据文件时发生以下错误:Microsoft.PowerShell.Core,C:\ Windows \ SysWOW64 \ WindowsPowerShell \v1.0 \types.ps1xml(87):类型为"System.DirectoryServices.PropertyValueCollection"的错误:异常:由于方法格式,无法创建
a代码方法。该方法应该是public,static,并且有一个类型为PSObject的参数。

加载扩展类型数据文件时发生以下错误:Microsoft.PowerShell.Core,C:\ Windows \ SysWOW64 \ WindowsPowerShell \v1.0 \types.ps1xml(353):类型为"System.DirectoryServices.DirectoryEntry"时出错:异常:由于方法格式,无法创建代码
方法。该方法应该是public,static,并且有一个类型为PSObject的参数。

加载扩展类型数据文件时发生以下错误:Microsoft.PowerShell.Core,C:\ Windows \ SysWOW64 \ WindowsPowerShell \v1.0 \types.ps1xml(360):类型为"System.DirectoryServices.DirectoryEntry"的错误:异常:由于方法格式,无法创建代码
方法。该方法应该是public,static,并且有一个类型为PSObject的参数。

加载扩展类型数据文件时发生以下错误:Microsoft.PowerShell.Core,C:\ Windows \ SysWOW64 \ WindowsPowerShell \v1.0 \types.ps1xml(372):类型为"System.IO.DirectoryInfo"的错误:异常:getter方法应该是public,
non void,static,并且有一个PSObject类型的参数。

加载扩展类型数据文件时发生以下错误:Microsoft.PowerShell.Core,C:\ Windows \ SysWOW64 \ WindowsPowerShell \v1.0 \ ttypes .ps1xml(399):类型为"System.IO.FileInfo"的错误:异常:getter方法应该是public,非
void,static,并且有一个PSObject类型的参数。

加载扩展类型数据文件时发生以下错误:Microsoft.PowerShell.Core,C:\ Windows \ SysWOW64 \ WindowsPowerShell \v1.0 \ _types.ps1xml(3007):错误type"System.Security.AccessControl.ObjectSecurity":Exception:getter
方法应该是public,non void,static,并且有一个类型为PSObject的参数。

发生以下错误加载扩展类型数据文件时:Microsoft.PowerShell.Core,C:\ Windows \ SysWOW64 \ WindowsPowerShell \v1.0 \ type.ps1xml(3014):类型为"System.Security.AccessControl"时出错。 ObjectSecurity":Exception:getter
方法应该是public,non void,static,并且有一个类型为PSObject的参数。

加载扩展类型数据文件时出现以下错误:Microsoft .PowerShell.Core,C:\ Windows \SysWOW64 \ WindowsPowerShell \v1.0 \ type.ps1xml(3021):类型为"System.Security.AccessControl.ObjectSecurity"的错误:异常:getter
方法应该是public,non void,static,并且有一个PSObject类型的参数。

加载MID时出现以下错误nded类型数据文件:Microsoft.PowerShell.Core,C:\ Windows \ SysWOW64 \ WindowsPowerShell \v1.0 \ type.ps1xml(3028):类型为"System.Security.AccessControl.ObjectSecurity"时出错:例外:getter
方法应该是public,non void,static,并且有一个类型为PSObject的参数。

加载扩展类型数据文件时出现以下错误:Microsoft.PowerShell。 Core,C:\ Windows \ SysWOW64 \ WindowsPowerShell \v1.0 \ type.ps1xml(3035):类型为"System.Security.AccessControl.ObjectSecurity"的错误:异常:getter
方法应该是public,non void,static,并且有一个PSObject类型的参数。

加载扩展类型数据文件时发生以下错误:Microsoft.PowerShell.Core,C:\ Windows \ SysWOW64 \ WindowsPowerShell \v1.0 \types.ps1xml(3249):类型错误"Microsoft.PowerShell.DeserializingTypeConverter":类型"Microsoft.Pow erShell.DeserializingTypeConverter"
应该是TypeConverter或PSTypeConverter。

加载扩展类型数据文件时发生以下错误:Microsoft.PowerShell.Core,C:\ Windows \ SysWOW64 \ WindowsPowerShell \\ \ uv1.0 \types.ps1xml(3678):类型为"System.Management.Automation.ParameterSetMetadata"的错误:异常:getter
方法应该是public,non void,static,并且有一个参数类型PSObject。
$
加载扩展类型数据文件时发生以下错误:Microsoft.PowerShell.Core,C:\ Windows \ SysWOW64 \ WindowsPowerShell \v1.0 \\\ = .types.x1xml (3763):类型"System.Management.Automation.FormatViewDefinition"中的错误:异常:getter
方法应该是public,non void,static,并且有一个类型为PSObject的参数。




我安装了相同的VS在我们的Jenkins构建服务器上,我没有收到错误。  ; 


提前感谢您的帮助,


Bob O'Connell



解决方案

嗨roconne,


欢迎来到MSDN论坛。


请尝试使用以下内容来解决此问题:


1.请打开
Visual Studio Installer ,尝试删除
NuGet包管理器
个别组件下,然后重新安装。


2.请将建议项添加到VS exe配置文件中,参考类似的

thread


< pre class ="prettyprint">< 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>
< dependentAss embly>
< assemblyIdentity name =" Microsoft.PowerShell.ConsoleHost"公钥=" 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


Not able to do a nuget restore.  I get a bunch errors in the Package Manager Console, and I'm not able to enter any commands.  Here are the errors:

The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(32) : Error in type "System.Xml.XmlNode": Exception: Cannot create a code method because of the method format. The method should be public, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(44) : Error in type "System.Xml.XmlNodeList": Exception: Cannot create a code method because of the method format. The method should be public, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(87) : Error in type "System.DirectoryServices.PropertyValueCollection": Exception: Cannot create a code method because of the method format. The method should be public, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(353) : Error in type "System.DirectoryServices.DirectoryEntry": Exception: Cannot create a code method because of the method format. The method should be public, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(360) : Error in type "System.DirectoryServices.DirectoryEntry": Exception: Cannot create a code method because of the method format. The method should be public, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(372) : Error in type "System.IO.DirectoryInfo": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(399) : Error in type "System.IO.FileInfo": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
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.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(3014) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(3021) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(3028) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(3035) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(3249) : Error in type "Microsoft.PowerShell.DeserializingTypeConverter": Type "Microsoft.PowerShell.DeserializingTypeConverter" should be a TypeConverter or an PSTypeConverter.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(3678) : Error in type "System.Management.Automation.ParameterSetMetadata": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(3763) : Error in type "System.Management.Automation.FormatViewDefinition": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.

I have the same VS installed on our Jenkins build server, and I don't get the errors.  

Thanks in advance for your help,

Bob O'Connell

解决方案

Hi roconne,

Welcome to the MSDN forum.

Please have a try with the following to troubleshoot this issue:

1.Please open Visual Studio Installer, try to Remove the NuGet package manager under Individual components, and re-install it.

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


这篇关于Visual Studio Enterprise 2017中的程序包管理器控制台错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆