Hi,

I have experienced this problem over the last couple of days and thought it
may be useful if I documented my experiences.  I can reproduce the problem
faithfully on my machine but have had little luck in debugging it.  If
someone wants to give me some guidance on debugging then I am more than
happy to help out.

I am running on Windows 7 Ultimate on a 64-bit laptop.  I have been using
NAnt 0.86 happily for a long time but now need to build projects on .NET 4.0
so I downloaded NAnt 0.91 Alpha 2.  This build of NAnt crashes every time I
try to execute it.  The reported error is as follows:

      Unhandled Exception: System.TypeInitializationException: The type in
itializer for 'NAnt.Console.ConsoleStub' threw an exception. --->
System.Securit
y.SecurityException: Request for the permission of type
'System.Security.Permiss
ions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToke
n=b77a5c561934e089' failed.
         at System.Security.CodeAccessSecurityEngine.Check(Object demand,
StackCrawlMark& stackMark, Boolean isPermSet)
         at System.Security.CodeAccessPermission.Demand()
         at System.AppDomainSetup.VerifyDir(String dir, Boolean normalize)

         at log4net.Config.XmlConfiguratorAttribute.Configure(Assembly sou
rceAssembly, ILoggerRepository targetRepository)
         at log4net.Core.DefaultRepositorySelector.ConfigureRepository(Ass
embly assembly, ILoggerRepository repository)
        at log4net.Core.DefaultRepositorySelector.CreateRepository(Assemb
ly repositoryAssembly, Type repositoryType, String repositoryName, Boolean
readA
ssemblyAttributes)
         at log4net.Core.DefaultRepositorySelector.GetRepository(Assembly
repositoryAssembly)
         at log4net.Core.LoggerManager.GetLogger(Assembly repositoryAssemb
ly, String name)
         at log4net.LogManager.GetLogger(Type type)
         at NAnt.Console.ConsoleStub..cctor() in c:\nant\12-05-2010\src\sr
c\NAnt.Console\ConsoleStub.cs:line 365
         --- End of inner exception stack trace ---
         at NAnt.Console.ConsoleStub.Main(String[] args)

I read the original bug report which suggested that the problem would be
solved by rebuilding NAnt from source on the machine you want it to run on.
That worked for me using the following steps:

1. Download and extract NAnt 0.86 to a clean directory.
2. Download the source code for the nightly build of NAnt dated 2010-07-15.
3. Use NAnt 0.86 to build the source code downloaded in step 2. Note that
the build will fail because the tests for the ReadRegistryTask reference a
registry location that doesn't exist on Win7 x64.  However, the binaries
will have been build by this point and they should be usable.

Hope someone finds this useful.

Regards,

Mark

On 6 October 2010 17:26, Ryan Boggs <rmbo...@gmail.com> wrote:

> Hi,
>
> This has been reported but since I am not able to reproduce on my machine I
> currently do not have an out of box solution (otherwise we'd be in beta mode
> now). From what I have heard from others with the same problem, rebuilding
> the source on the target machine seems to work. So that should get you going
> for now.
>
> If anyone out there with this problem would like to help, please let me
> know so this bug can get squashed correctly.
>
> Thanks,
> Ryan
>
> On Oct 6, 2010, at 8:57 AM, Marcus Weidner <mweid...@gmail.com> wrote:
>
> > I have been using NAnt 0.91-alpha2 on our Server 2003 Standard Edition
> > server to manage several of our build tasks, yesterday I upgraded to
> > .NET 4.0 via windows update and I am now getting an error when I try
> > to run NAnt, even if I open up a console window and just try running
> > "nant.exe" with no arguments I am getting an error.  I also confirmed
> > the same thing is happening on my Windows XP development box.  On my
> > XP machine I got the following error:
> >
> > C:\Program Files\nant-0.91-alpha2\bin>nant.exe
> >
> > Unhandled Exception: System.TypeInitializationException: The type
> > initializer for 'NAnt.Console.ConsoleStub' threw an exception. --->
> > System.Security.SecurityException: Request for the permission of type
> > 'System.Security.Permissions.FileIOPermission, mscorlib,
> > Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
> > failed.
> >   at System.Security.CodeAccessSecurityEngine.Check(Object demand,
> > StackCrawlMark& stackMark, Boolean isPermSet)
> >   at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission
> > cap, StackCrawlMark& stackMark)
> >   at System.Security.CodeAccessPermission.Demand()
> >   at System.AppDomainSetup.VerifyDir(String dir, Boolean normalize)
> >   at System.AppDomain.get_BaseDirectory()
> >   at log4net.Config.XmlConfiguratorAttribute.Configure(Assembly
> > sourceAssembly, ILoggerRepository targetRepository)
> >   at log4net.Core.DefaultRepositorySelector.ConfigureRepository(Assembly
> > assembly, ILoggerRepository repository)
> >   at log4net.Core.DefaultRepositorySelector.CreateRepository(Assembly
> > repositoryAssembly, Type repositoryType, String repositoryName,
> > Boolean readAssemblyAttributes)
> >   at log4net.Core.DefaultRepositorySelector.CreateRepository(Assembly
> > repositoryAssembly, Type repositoryType)
> >   at log4net.Core.DefaultRepositorySelector.GetRepository(Assembly
> > repositoryAssembly)
> >   at log4net.Core.LoggerManager.GetLogger(Assembly
> > repositoryAssembly, String name)
> >   at log4net.LogManager.GetLogger(Assembly repositoryAssembly, String
> name)
> >   at log4net.LogManager.GetLogger(Type type)
> >   at NAnt.Console.ConsoleStub..cctor()
> >   --- End of inner exception stack trace ---
> >   at NAnt.Console.ConsoleStub.Main(String[] args)
> >
> > C:\Program Files\nant-0.91-alpha2\bin>
> >
> > So everything was working fine using .NET 3.5, but as soon as I
> > upgraded to .NET 4.0 I get the error I referenced above.  Any
> > suggestions on what could be causing this?  Also I confirmed that I am
> > getting the same error when I tried running the nightly build
> > (nant-0.91-nightly-2010-05-12).
> >
> > Thank You.
> > --
> > Marcus Weidner
> > www.KD8ITX.com
> >
> >
> ------------------------------------------------------------------------------
> > Beautiful is writing same markup. Internet Explorer 9 supports
> > standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> > Spend less time writing and  rewriting code and more time creating great
> > experiences on the web. Be a part of the beta today.
> > http://p.sf.net/sfu/beautyoftheweb
> > _______________________________________________
> > NAnt-users mailing list
> > NAnt-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/nant-users
>
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today.
> http://p.sf.net/sfu/beautyoftheweb
> _______________________________________________
> NAnt-users mailing list
> NAnt-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nant-users
>
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to