asp.net – 安装MvcScaffolding包时的NuGet执行策略错误
我正在使用Visual Web Developer Express 2010,Windows XP,并在项目中使用ASP.NET MVC4 RC.我安装了NuGet v2.0.30619.9119.
我现在正尝试通过NuGet Package Manager Console安装MvcScaffolding软件包.我收到以下错误: 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:asppackagesT4Scaffolding.1.0.6toolsinit.ps1 cannot be loaded. The file Y:asppackagesT4Scaffolding.1.0.6toolsinit.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:asppackagesT4Scaffolding.1.0.6toolsinit.ps1' $__rootPath $__toolsPath $__package $__project + CategoryInfo : NotSpecified: (:) [],PSSecurityException + FullyQualifiedErrorId : RuntimeException Successfully installed 'MvcScaffolding 1.0.7'. File Y:asppackagesMvcScaffolding.1.0.7toolsinit.ps1 cannot be loaded. The file Y:asppackagesMvcScaffolding.1.0.7toolsinit. 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:asppackagesMvcScaffolding.1.0.7toolsinit.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:asppackagesT4Scaffolding.1.0.6toolsinstall.ps1 cannot be loaded. The file Y:asppackagesT4Scaffolding.1.0.6toolsinst 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:asppackagesT4Scaffolding.1.0.6toolsinstall.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:asppackagesMvcScaffolding.1.0.7toolsinstall.ps1 cannot be loaded. The file Y:asppackagesMvcScaffolding.1.0.7toolsin 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:asppackagesMvcScaffolding.1.0.7toolsinstall.ps1' $__rootPath $__toolsPath $__package $__project + CategoryInfo : NotSpecified: (:) [],PSSecurityException + FullyQualifiedErrorId : RuntimeException 由于安装后未执行init脚本,因此未正确安装MvcScaffolding包并且无法识别scaffold命令. 我不知道如何处理这些代码签名问题.以下是当前的安全设置: PM> Get-ExecutionPolicy -List Scope ExecutionPolicy ----- --------------- MachinePolicy Undefined UserPolicy Undefined Process RemoteSigned CurrentUser Undefined LocalMachine Unrestricted 我可以将Process范围更改为Unrestricted吗?如果是这样,怎么样?在NuGet控制台中运行Set-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 我也尝试过以管理员身份做这一切,但也没有帮助. 任何建议或想法将不胜感激. UPDATE 我可以在NuGet中设置流程执行策略,如下所示: Set-ExecutionPolicy Unrestricted -Scope Process 但是当我重新启动Visual Web Developer时,设置被遗忘了,我仍然遇到错误,因为它一直在尝试执行init.psl文件 如何永久更改执行策略? 解决方法
好的,我现在正确安装了MvcScaffolding.
我不得不首先绕过NuGet中的所有安全性: Set-ExecutionPolicy Bypass -Scope Process 但是当我重新启动Visual Web Developer时,我仍然会在启动时使用运行init.pls的NuGet获得相同的PowerShell错误. 我已经知道这是因为我将我的项目存储在网络驱动器上.显然,PowerShell默认情况下不会从网络驱动器执行脚本. 我尝试使用CasPol来更改安全设置,但无法使其工作.当我看到其他人无法让VS使用映射驱动器时,我放弃了: CAS not working for VS2010 mapped drive 无论如何,我现在只有我的项目本地,并且MvcScaffolding已安装并正常工作. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- asp.net-mvc – ASP.NET MVC和混合模式认证
- NHibernate中对同一个对象的Lazyload要设置一致
- 标签 – 如何使用像asp这样的Razor:Literal?
- C#_.Net Core 3.1 WebAPI_Excel数据读取与写入_自定义解析封
- asp.net-mvc – 如何在MVC Filter属性中解析依赖注入
- asp.net-mvc – Asp.net MVC5,如何加载.hbs文件
- 没有更新过期的ASP.NET Cookie更新值?
- ASP.NET MVC路由的无限URL参数
- .net – 如何向用户发送电子邮件确认链接
- entity-framework – 具有列表的实体框架复杂对象
- asp.net-mvc – Knockout Js,JQuery UI Dialog和
- 谈谈基于SQL Server 的Exception Handling[中篇]
- asp.net – 向GridView Row添加ID
- IIS ASP.NET vs(NGINX FastCGI Mono或XSP)的性能
- asp.net – 配置IIS服务器使用Aurelia框架并推送
- image – 在MVC webgrid中添加“加载”指示符?
- IIS7集成vs经典流水线 – 哪些使用更多的ASP.NET
- asp.net-mvc-3 – MVC按钮点击动作
- asp.net-mvc – 如何测试MVC3 razor布局中是否存
- ASP.NET MVC4异步聊天室的示例代码