Still learning as we go with this continuous integration project...  To fix the problem of PInvoke and its metadata (or whatever), I have to add the following to nunit-console.exe.config:

 

            <startup>

                        <supportedRuntime version="v1.1.4322" />

            </startup>

 

[Found on http://weblogs.asp.net/JAvery/posts/5892.aspx.  Thanx, James.]

 

M$ changed some major thangs with XML, especially config files and tag parsers (not the first time we've been bitten here) in the 1.1 change...

 

However, NAnt doesn't seem to respect the nunit-console.config file (hoping I've simply overlooked something significant with regards to Framework version config for the NAnt2 task).  This is a big problem for us, since we keep all of our tests' configuration (connection strings and such) in external files assemblyname.dll.config files, so I'll make time to look into the NUnit2 code if nobody has a quick answer on the subject.

 

This is all that I can get out of NAnt in "verbose" on the subject:

 

BUILD FAILED

 

NUnit 2.0 Error:

Exception has been thrown by the target of an invocation.

 

The problem is documented elsewhere to be fixed by the above config entry and running the tests directly using nunit-console without the necessary modification results in much more helpful stuff (NOTE: nunit-console.exe works like a charm with the appropriate config modification):

 

NUnit version 2.0.6

Copyright (C) 2002 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.

Copyright (C) 2000-2002 Philip Craig.

All Rights Reserved.

 

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has

been thrown by the target of an invocation. ---> System.Configuration.Configurat

ionException: Error loading XML file c:\windows\microsoft.net\framework\v1.0.370

5\Config\machine.config Request for the permission of type System.Security.Permi

ssions.StrongNameIdentityPermission, mscorlib, Version=1.0.3300.0, Culture=neutr

al, PublicKeyToken=b77a5c561934e089 failed. (c:\windows\microsoft.net\framework\

v1.0.3705\Config\machine.config)

   at System.Configuration.ConfigurationRecord.OpenXmlTextReader(String configFi

leName)

   at System.Configuration.ConfigurationRecord.Load(String filename)

   at System.Configuration.DefaultConfigurationSystem.System.Configuration.IConf

igurationSystem.Init()

   at System.Configuration.ConfigurationSettings.SetConfigurationSystem(IConfigu

rationSystem configSystem)

   at System.Configuration.ConfigurationSettings.GetConfig(String sectionName)

   at System.Configuration.ConfigurationSettings.get_AppSettings()

   at eRealty.Desktop.AppointmentCalendar.TestCalendarUserControl..ctor() in c:\

build\desktop\appointmentcalendar\Calendar.ascx.cs:line 33

   --- End of inner exception stack trace ---

 

Server stack trace:

   at System.Reflection.RuntimeConstructorInfo.InternalInvoke(BindingFlags invok

eAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinder

Default)

   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, B

inder binder, Object[] parameters, CultureInfo culture)

   at NUnit.Core.TestSuiteBuilder.BuildTestFixture(Type fixtureType)

   at NUnit.Core.TestSuiteBuilder.Build(String assemblyName)

   at NUnit.Core.RemoteTestRunner.BuildSuite()

   at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)

   at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(M

ethodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInC

ontext, Object[]& outArgs)

   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMes

sage msg, Int32 methodPtr, Boolean fExecuteInContext)

 

Exception rethrown at [0]:

   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req

Msg, IMessage retMsg)

   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa

ta, Int32 type)

   at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)

   at NUnit.Framework.TestDomain.MakeRemoteTestRunner(FileInfo file, AppDomain r

unnerDomain)

   at NUnit.Framework.TestDomain.Load(String assemblyFileName)

   at NUnit.Console.ConsoleUi.MakeTestFromCommandLine(TestDomain testDomain, Com

mandLineParser parser)

   at NUnit.Console.ConsoleUi.Main(String[] args)

Reply via email to