简体   繁体   English

MVC 3文件,新项目中的程序包管理器控制台中的NuGet错误

[英]NuGet errors in Package Manager Console on MVC 3 File, New Project

So I installed the new MVC3 tooling update and attempted to create a new MVC3 web app. 所以我安装了新的MVC3工具更新,并尝试创建一个新的MVC3 Web应用程序。 The project reports as being successfully created but if I bring up the Package Manager Console, I see the following... 项目报告成功创建,但如果我打开包管理器控制台,我会看到以下内容......

The following error occurred while loading the extended type data file: , D:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\Extensions\\Microsoft Corporation\\NuGet Package Manager\\1.2.20325.9034\\Scripts\\NuGet.Types.ps1xml : File skipped because of the following validation exception: File D:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\Extensions\\Microsoft Corporation\\NuGet Package Manager\\1.2.20325.9034\\Scripts\\NuGet.Types.ps1xml cannot be loaded. 加载扩展类型数据文件时出现以下错误:,D:\\ Program Files(x86)\\ Microsoft Visual Studio 10.0 \\ Common7 \\ IDE \\ Extensions \\ Microsoft Corporation \\ NuGet Package Manager \\ 1.2.20325.9034 \\ Scripts \\ NuGet.Types。 ps1xml:由于以下验证异常而跳过了文件:文件D:\\ Program Files(x86)\\ Microsoft Visual Studio 10.0 \\ Common7 \\ IDE \\ Extensions \\ Microsoft Corporation \\ NuGet Package Manager \\ 1.2.20325.9034 \\ Scripts \\ NuGet.Types.ps1xml无法加载。 The file D:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\Extensions\\Microsoft Corporation\\NuGet Package Manager\\1.2.20325.9034\\Scripts\\NuGet.Types.ps1xml is not digitally signed. 文件D:\\ Program Files(x86)\\ Microsoft Visual Studio 10.0 \\ Common7 \\ IDE \\ Extensions \\ Microsoft Corporation \\ NuGet Package Manager \\ 1.2.20325.9034 \\ Scripts \\ NuGet.Types.ps1xml未经过数字签名。 The script will not execute on the system. 该脚本不会在系统上执行。 Please see "get-help about_signing" for more details... There were errors in loading the format data file: D:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\Extensions\\Microsoft Corporation\\NuGet Package Manager\\1.2.20325.9034\\Scripts\\NuGet.Format.ps1xml, , D:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\Extensions\\Microsoft Corporation\\NuGet Package Manager\\1.2.20325.9034\\Scripts\\NuGet.Format.ps1xml : File skipped because of the following validation exception: File D:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\Extensions\\Microsoft Corporation\\NuGet Package Manager\\1.2.20325.9034\\Scripts\\NuGet.Format.ps1xml cannot be loaded. 有关详细信息,请参阅“get-help about_signing”...加载格式数据文件时出错:D:\\ Program Files(x86)\\ Microsoft Visual Studio 10.0 \\ Common7 \\ IDE \\ Extensions \\ Microsoft Corporation \\ NuGet Package Manager \\ 1.2.20325.9034 \\ Scripts \\ NuGet.Format.ps1xml ,, D:\\ Program Files(x86)\\ Microsoft Visual Studio 10.0 \\ Common7 \\ IDE \\ Extensions \\ Microsoft Corporation \\ NuGet Package Manager \\ 1.2.20325.9034 \\ Scripts \\ NuGet.Format .ps1xml:由于以下验证异常而跳过了文件:文件D:\\ Program Files(x86)\\ Microsoft Visual Studio 10.0 \\ Common7 \\ IDE \\ Extensions \\ Microsoft Corporation \\ NuGet Package Manager \\ 1.2.20325.9034 \\ Scripts \\ NuGet.Format。 ps1xml无法加载。 The file D:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\Extensions\\Microsoft Corporation\\NuGet Package Manager\\1.2.20325.9034\\Scripts\\NuGet.Format.ps1xml is not digitally signed. 文件D:\\ Program Files(x86)\\ Microsoft Visual Studio 10.0 \\ Common7 \\ IDE \\ Extensions \\ Microsoft Corporation \\ NuGet Package Manager \\ 1.2.20325.9034 \\ Scripts \\ NuGet.Format.ps1xml未经过数字签名。 The script will not execute on the system. 该脚本不会在系统上执行。 Please see "get-help about_signing" for more details... 有关详细信息,请参阅“get-help about_signing”...

So it appears that there are two errors occurring here, one while trying to load the extended data file and one while loading a format data file. 因此,这里出现两个错误,一个是在尝试加载扩展数据文件时,另一个是在加载格式数据文件时。

I have installed powershell 2.0. 我已经安装了powershell 2.0。 Anyone have any ideas? 有人有主意吗? Should I care if the project got created successfully (I think)? 我是否应该关心项目是否成功创建(我认为)?

How did you install NuGet? 你是怎么安装NuGet的?

I was just wrestling with a similar error that was caused because I extracted a Powershell module without first clicking "Unblock" in the properties of the zip file before extracting. 我只是因为我提取了一个Powershell模块而没有在解压缩之前单击zip文件属性中的“Unblock”而导致类似错误。 This meant all the files were flagged as coming from the internet, and RemoteSigned won't allow unsigned remote files to be run. 这意味着所有文件都被标记为来自互联网,而RemoteSigned将不允许运行未签名的远程文件。

Navigate to the folder that contains the files mentioned, and open the Properties dialog for them, and see if there's a message saying "This file came from the internet" with an "Unblock" button. 导航到包含所提及文件的文件夹,然后打开它们的“属性”对话框,并查看是否显示“此文件来自Internet”的消息,并显示“取消阻止”按钮。 If so, click it for each file, and then try again. 如果是这样,请为每个文件单击它,然后重试。

For some reason I frequently run into a similar issue. 出于某种原因,我经常遇到类似的问题。 All NuGet files are unlocked, and just restarting VS (by opening the sln file) does not fix it. 所有NuGet文件都已解锁,只需重新启动VS(通过打开sln文件)就无法修复它。 What does is opening up Visual Studio by itself, without loading the solution, then opening up the Package Manager Console, and then opening the solution. 什么是自行打开Visual Studio,无需加载解决方案,然后打开包管理器控制台, 然后打开解决方案。

This error for me was caused by .Net Reflector (free version). 这个错误对我来说是由.Net Reflector(免费版)引起的。 Used the Addin Manager to disable it and I'm fine. 使用Addin Manager禁用它,我很好。

I had same error! 我有同样的错误! My solution was really simple. 我的解决方案非常简单。 Just right click Visual Studio and select "Run as administrator" when you try to open your solution. 只需右键单击Visual Studio,然后在尝试打开解决方案时选择“以管理员身份运行”。

I believe you need to be running Visual Studio as administrator. 我相信您需要以管理员身份运行Visual Studio。

In Package Manager console, you can check Powershell's execution policy. 在Package Manager控制台中,您可以检查Powershell的执行策略。 Type "get-executionpolicy". 输入“get-executionpolicy”。 It will be a value like "RemoteSigned" by default. 默认情况下它将是“RemoteSigned”之类的值。 MvcScaffolding is signed, so it will run under this policy. MvcScaffolding已签署,因此它将在此政策下运行。

Here is an Url with more info: http://technet.microsoft.com/en-us/library/dd347649.aspx 这是一个包含更多信息的网址: http//technet.microsoft.com/en-us/library/dd347649.aspx

and here are the various execution policies documented: http://technet.microsoft.com/en-us/library/dd347628.aspx 以下是记录的各种执行策略: http//technet.microsoft.com/en-us/library/dd347628.aspx

Here is an excerpt from torm the first link: If you try to run a downloaded script, Windows PowerShell displays the following error message: 以下是第一个链接的摘录:如果您尝试运行下载的脚本,Windows PowerShell将显示以下错误消息:

    The file <file-name> cannot be loaded. The file 
    <file-name> is not digitally signed. The script
    will not execute on the system. Please see "Get-Help
    about_signing" for more details.

Before you run the script, review the code to be sure that you trust it.
Scripts have the same effect as any executable program.

To run an unsigned script:

    1. Save the script file on your computer. 
    2. Click Start, click My Computer, and locate the saved script file. 
    3. Right-click the script file, and then click Properties. 
    4. Click Unblock.

If a script that was downloaded from the Internet is digitally signed, but
you have not yet chosen to trust its publisher, Windows PowerShell displays
the following message:

    Do you want to run software from this untrusted publisher? 
    The file <file-name> is published by CN=<publisher-name>. This 
    publisher is not trusted on your system. Only run scripts
    from trusted publishers.

    [V] Never run  [D] Do not run  [R] Run once  [A] Always run  
    [?] Help (default is "D"):

    If you trust the publisher, select "Run once" or "Always run." 
    If you do not trust the publisher, select either "Never run" or 
    "Do not run." If you select "Never run" or "Always run," Windows
    PowerShell will not prompt you again for this publisher.

Hope that helps. 希望有所帮助。

You may want to simply change the Powershell Execution Policy to unrestricted. 您可能只想将Powershell执行策略更改为不受限制。 See this Microsoft KB article KB 2411920 . 请参阅此Microsoft知识库文章KB 2411920

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM