Problem with a "local" configuration file

"Sergey Popov" <[email protected]> Tue, 9 Sep 2008 14:07:13 +0600
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <[email protected]>
Hi All!

I've got a problem with a "local" configuration file. I created a
simple project to illustrate the problem:
http://207.168.43.174/ConfBug.zip

If I run the test directly it completes successfully. But if I use
NUnit Project the test is failed!

"%ProgramFiles%\NUnit 2.4.8\bin\nunit-console.exe"
bin\Debug\ConfBug.dll - success!
"%ProgramFiles%\NUnit 2.4.8\bin\nunit-console.exe" ConfBug.nunit - failed!

Please, help me find the problem.

Thank you,
Sergey.


ConfBugTest.cs:
--------------------------------------------------
using System;
using System.Collections.Specialized;
using System.Configuration;

using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;

namespace ConfBug
{
    [TestFixture]
    public class ConfBugTest
    {
        [Test]
        public void Test1()
        {
            NameValueCollection values =
ConfigurationManager.GetSection("MySection") as NameValueCollection;

            Assert.That(values, Is.Not.Null);
        }
    }
}


App.config:
--------------------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <section name="MySection"
type="System.Configuration.NameValueSectionHandler" />
    </configSections>
    <MySection>
        <add key="MyKey" value="MyValue" />
    </MySection>
</configuration>


ConfBug.nunit:
--------------------------------------------------
<NUnitProject>
  <Settings activeconfig="Debug" />
  <Config name="Debug" binpathtype="Auto">
    <assembly path="bin\Debug\ConfBug.dll" />
  </Config>
  <Config name="Release" binpathtype="Auto" />
</NUnitProject>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/