繁体   English   中英

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

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

所以我安装了新的MVC3工具更新,并尝试创建一个新的MVC3 Web应用程序。 项目报告成功创建,但如果我打开包管理器控制台,我会看到以下内容......

加载扩展类型数据文件时出现以下错误:,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无法加载。 文件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未经过数字签名。 该脚本不会在系统上执行。 有关详细信息,请参阅“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无法加载。 文件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未经过数字签名。 该脚本不会在系统上执行。 有关详细信息,请参阅“get-help about_signing”...

因此,这里出现两个错误,一个是在尝试加载扩展数据文件时,另一个是在加载格式数据文件时。

我已经安装了powershell 2.0。 有人有主意吗? 我是否应该关心项目是否成功创建(我认为)?

你是怎么安装NuGet的?

我只是因为我提取了一个Powershell模块而没有在解压缩之前单击zip文件属性中的“Unblock”而导致类似错误。 这意味着所有文件都被标记为来自互联网,而RemoteSigned将不允许运行未签名的远程文件。

导航到包含所提及文件的文件夹,然后打开它们的“属性”对话框,并查看是否显示“此文件来自Internet”的消息,并显示“取消阻止”按钮。 如果是这样,请为每个文件单击它,然后重试。

出于某种原因,我经常遇到类似的问题。 所有NuGet文件都已解锁,只需重新启动VS(通过打开sln文件)就无法修复它。 什么是自行打开Visual Studio,无需加载解决方案,然后打开包管理器控制台, 然后打开解决方案。

这个错误对我来说是由.Net Reflector(免费版)引起的。 使用Addin Manager禁用它,我很好。

我有同样的错误! 我的解决方案非常简单。 只需右键单击Visual Studio,然后在尝试打开解决方案时选择“以管理员身份运行”。

我相信您需要以管理员身份运行Visual Studio。

在Package Manager控制台中,您可以检查Powershell的执行策略。 输入“get-executionpolicy”。 默认情况下它将是“RemoteSigned”之类的值。 MvcScaffolding已签署,因此它将在此政策下运行。

这是一个包含更多信息的网址: http//technet.microsoft.com/en-us/library/dd347649.aspx

以下是记录的各种执行策略: http//technet.microsoft.com/en-us/library/dd347628.aspx

以下是第一个链接的摘录:如果您尝试运行下载的脚本,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.

希望有所帮助。

您可能只想将Powershell执行策略更改为不受限制。 请参阅此Microsoft知识库文章KB 2411920

暂无
暂无

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

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