gpt4 book ai didi

visual-studio-2013 - 控制台上的 Visual Studio 2013/15 Nuget 错误 - "The module to process ' nuget.psm 1', listed in field ' ModuleToProcess' of module manifest..."

转载 作者:行者123 更新时间:2023-12-04 07:53:45 25 4
gpt4 key购买 nike

打开 Nuget 控制台我收到以下错误:

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(2977) : 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(2984) : 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(2991) : 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(2998) : 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(3005) : 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(3219) : 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(3648) : 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(3733) : Error in type "System.Management.Automation.FormatViewDefinition": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject. The module to process 'nuget.psm1', listed in field 'ModuleToProcess' of module manifest 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\EXTENSIONS\QIYNP3CN.X43\Modules\NuGet\NuGet.psd1' was not processed because no valid module was found in any module directory.



我可以更新一些 nuget 包,但不能更新 Entity Framework 和其他一些包。对于后者,我收到一个错误:

"...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."



我应该补充一点,我有 Windows 8.1 Pro 64 位。

最佳答案

这解释了如何解决我的部分问题(但不知道为什么会发生):
http://social.msdn.microsoft.com/Forums/en-US/0b20e64e-e35f-4d0e-91f1-aebcfda7ebf2/package-manager-console-failed-to-load?forum=visualstudiogeneral

因此,编辑 devenv.exe.config 并添加以下内容(您可能不需要“runtime”或“assemblyBinding”标签,但您明白了:

 <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>

现在这解决了我无法更新 NuGet 包的问题。但是我仍然看到错误,即:

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.



底线我一定搞砸了我的 Windows 8.1 Pro 权限。我试图将 Visual Studio 2013 中的链接打开到 Chrome 中,所以我以管理员身份安装了 Chrome……其余的都是历史。

如果我有时间,我会重新安装 Windows 8.1,但上述临时解决方案只是……一个临时解决方案。

我发现没有 Windows“修复”,似乎没有人遇到过同样的问题。

希望这种帮助其他人。

关于visual-studio-2013 - 控制台上的 Visual Studio 2013/15 Nuget 错误 - "The module to process ' nuget.psm 1', listed in field ' ModuleToProcess' of module manifest...",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23333057/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com