在命令提示符下运行NAnt.exe时出错 [英] Getting Error when run NAnt.exe on Command Prompt
本文介绍了在命令提示符下运行NAnt.exe时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当部署使用NAnt的Web应用程序在命令提示符上出现以下错误时
When Deploye web application using NAnt getting following error on Command Prompt
Unhandled Exception: System.Security.SecurityException: Request for Configuratio
nPermission failed while attempting to access configuration section 'nant'. To a
llow all callers to access the data for this section, set section attribute 'req
uirePermission' equal 'false' in the configuration file where this section is de
clared. ---> System.Security.SecurityException: Request for the permission of ty
pe 'System.Configuration.ConfigurationPermission, System.Configuration, Version=
4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMa
rk& stackMark, Boolean isPermSet)
at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, S
tackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
at System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String
configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca)
--- End of inner exception stack trace ---
at System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String
configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String co
nfigKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Bool
ean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Configuration.ClientConfigurationSystem.System.Configuration.Intern
al.IInternalConfigSystem.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at NAnt.Console.ConsoleStub.Framework.GetRuntimeFramework()
at NAnt.Console.ConsoleStub.Main(String[] args)
推荐答案
问题出在Windows 7 64位解压缩期间。
解压缩时,
1.转到您的nant - ** zip文件 - >右键单击 - >在对话框中单击取消阻止按钮
2。将nant - ***文件夹复制到c:\Program Files
3.创建一个nant bat文件并复制到C:\ Windows \\ />
就是这样!!!!!
The problem is during the unzipping in Windows 7 64 bit.
While unzipping,
1.Go to your nant-** zip file-->right click-->In the dialog click "unblock button"
2.Copy the nant-*** folder to c:\Program Files
3.Create a nant bat file and copy to C:\Windows
That`s it!!!!!
这篇关于在命令提示符下运行NAnt.exe时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文