nant/nant — Issue #16: Permissions error on Windows 7 Home
Author: StefanRoss
Created: 2011-12-29 19:11:29+00:00
State: open

Downloaded nant 0.91 binary, installed per the instructions (copied to C:\Program Files\Nant). Also tried Program Files (x86). Both times I get the following error:

C:\Program Files\NAnt\bin>nant.exe
log4net:ERROR XmlConfiguratorAttribute: Exception getting ConfigurationFileLocat
ion. Must be able to resolve ConfigurationFileLocation when ConfigFile and Confi
gFileExtension properties are not set.
System.Security.SecurityException: Request for the permission of type 'System.Se
curity.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' 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.AppDomainSetup.VerifyDir(String dir, Boolean normalize)
at log4net.Util.SystemInfo.get_ConfigurationFileLocation()
at log4net.Config.XmlConfiguratorAttribute.ConfigureFromFile(Assembly sourceA
ssembly, ILoggerRepository targetRepository)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.FileIOPermission
The Zone of the assembly that failed was:
Internet

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)

Looks like a permissions problem. I'm running Windows 7 Home as a non-admin.