的NuGet执行策略错误,当安装MvcScaffolding包 [英] NuGet execution policy errors when installing MvcScaffolding package

查看:606
本文介绍了的NuGet执行策略错误,当安装MvcScaffolding包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Visual Web Developer中前preSS 2010年,Windows XP中,并在项目中使用ASP.NET MVC4 RC。我有v2.0.30619.9119安装的NuGet。

I'm using Visual Web Developer Express 2010, Windows XP, and using ASP.NET MVC4 RC in a project. I have NuGet v2.0.30619.9119 installed.

我现在正试图通过安装包的NuGet管理器控制台的MvcScaffolding包。我收到以下错误:

I'm now trying to install the MvcScaffolding package via NuGet Package Manager Console. I get the following errors:

PM> Install-Package MvcScaffolding
Attempting to resolve dependency 'T4Scaffolding'.
Attempting to resolve dependency 'EntityFramework (≥ 4.1.10311.0)'.
You are downloading EntityFramework from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=224682. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'EntityFramework 4.1.10715.0'.
Successfully installed 'T4Scaffolding 1.0.6'.
File Y:\asp\packages\T4Scaffolding.1.0.6\tools\init.ps1 cannot be loaded. The file Y:\asp\packages\T4Scaffolding.1.0.6\tools\init.ps
1 is not digitally signed. The script will not execute on the system. Please see "get-help about_signing" for more details..
At line:1 char:2
+ & <<<<  'Y:\asp\packages\T4Scaffolding.1.0.6\tools\init.ps1' $__rootPath $__toolsPath $__package $__project
    + CategoryInfo          : NotSpecified: (:) [], PSSecurityException
    + FullyQualifiedErrorId : RuntimeException

Successfully installed 'MvcScaffolding 1.0.7'.
File Y:\asp\packages\MvcScaffolding.1.0.7\tools\init.ps1 cannot be loaded. The file Y:\asp\packages\MvcScaffolding.1.0.7\tools\init.
ps1 is not digitally signed. The script will not execute on the system. Please see "get-help about_signing" for more details..
At line:1 char:2
+ & <<<<  'Y:\asp\packages\MvcScaffolding.1.0.7\tools\init.ps1' $__rootPath $__toolsPath $__package $__project
    + CategoryInfo          : NotSpecified: (:) [], PSSecurityException
    + FullyQualifiedErrorId : RuntimeException

Successfully added 'EntityFramework 4.1.10715.0' to MyProject.Web.
Successfully added 'T4Scaffolding 1.0.6' to MyProject.Web.
File Y:\asp\packages\T4Scaffolding.1.0.6\tools\install.ps1 cannot be loaded. The file Y:\asp\packages\T4Scaffolding.1.0.6\tools\inst
all.ps1 is not digitally signed. The script will not execute on the system. Please see "get-help about_signing" for more details..
At line:1 char:2
+ & <<<<  'Y:\asp\packages\T4Scaffolding.1.0.6\tools\install.ps1' $__rootPath $__toolsPath $__package $__project
    + CategoryInfo          : NotSpecified: (:) [], PSSecurityException
    + FullyQualifiedErrorId : RuntimeException

'InstallationDummyFile.txt' already exists. Skipping...
Successfully added 'MvcScaffolding 1.0.7' to MyProject.Web.
File Y:\asp\packages\MvcScaffolding.1.0.7\tools\install.ps1 cannot be loaded. The file Y:\asp\packages\MvcScaffolding.1.0.7\tools\in
stall.ps1 is not digitally signed. The script will not execute on the system. Please see "get-help about_signing" for more details..
At line:1 char:2
+ & <<<<  'Y:\asp\packages\MvcScaffolding.1.0.7\tools\install.ps1' $__rootPath $__toolsPath $__package $__project
    + CategoryInfo          : NotSpecified: (:) [], PSSecurityException
    + FullyQualifiedErrorId : RuntimeException

由于初始化脚本没有被安装,该MvcScaffolding包未正确安装和支架命令不被识别后执行。

Because the init scripts aren't being executed after the install, the MvcScaffolding package is not installed correctly and the scaffold command is not recognised.

我不知道该怎么做这些code签约的问题。以下是当前安全设置:

I don't know what to do about these code signing issues. Here are the current security settings:

PM> Get-ExecutionPolicy -List
Scope           ExecutionPolicy
-----           ---------------
MachinePolicy   Undefined
UserPolicy      Undefined
Process         RemoteSigned
CurrentUser     Undefined
LocalMachine    Unrestricted

我可以更改流程范围是无限制?如果是这样,怎么样?在控制台的NuGet运行设置ExecutionPolicy 不起作用:

PM> Set-ExecutionPolicy Unrestricted
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic. Do you want to change the execution policy?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):Y
Set-ExecutionPolicy : Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope.  Due to the override, your shell will
 retain its current effective execution policy of "RemoteSigned". Type "Get-ExecutionPolicy -List" to view your execution policy settings. For more information, please see "Get-Help Set-ExecutionPol
icy."
At line:1 char:20
+ Set-ExecutionPolicy <<<<  Unrestricted
    + CategoryInfo          : PermissionDenied: (:) [Set-ExecutionPolicy], SecurityException
    + FullyQualifiedErrorId : ExecutionPolicyOverride,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand

我也试着做这一切作为一个管理员,但这并没有帮助的。

I've also tried doing all of this as an Administrator and that didn't help either.

任何意见或想法会大大AP preciated。

Any advice or ideas would be much appreciated.

更新

我可以设置的NuGet流程执行的政策是这样的:

I can set the process execution policy in NuGet like this:

Set-ExecutionPolicy Unrestricted -Scope Process

但是,当我重​​新启动Visual Web Developer中,设置将被遗忘,因为它不停地尝试执行 init.psl 文件,我还得到一个错误

But when I restart Visual Web Developer, the setting is forgotten and I still get an error as it keeps trying to execute the init.psl files

我怎样才能永久地改变执行策略?

How can I change the execution policy permanently?

推荐答案

OK,我已经正确安装,现在MvcScaffolding。

OK, I have MvcScaffolding installed correctly now.

我只好先旁路的NuGet所有安全:

I had to first bypass all security in NuGet:

Set-ExecutionPolicy Bypass -Scope Process

但是,当我重​​新启动Visual Web Developer中我仍然得到同样的错误的PowerShell用的NuGet运行 init.pls 在启动待办事项。

我已经计算出那是因为我是一个存储网络驱动器上我的项目。显然,PowerShell不会默认执行从网络驱动器的脚本。

I've worked out that it's because I was storing my project on a network drive. Apparently PowerShell won't execute scripts from the network drive by default.

我试着用CasPol更改安全设置,但不能让它开始工作。我放弃了,当我看到其他人无法得到VS与映射驱动器以及工作:

I tried using CasPol to change the security settings, but couldn't get it to work. I gave up when I saw other people couldn't get VS to work with mapped drives as well:

<一个href=\"http://stackoverflow.com/questions/7171176/cas-not-working-for-vs2010-mapped-drive/7444666#7444666\">CAS不工作的VS2010映射驱动器

反正,我只是有我的项目的本地,现在,MvcScaffolding已安装并正常工作。

Anyway, I just have my project local now, and MvcScaffolding is installed and working.

这篇关于的NuGet执行策略错误,当安装MvcScaffolding包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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