By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,424 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,424 IT Pros & Developers. It's quick & easy.

Nant - Nunit2 configuration

P: n/a
I am trying to run nunit2 from nant and get the following error:

NUnit 2.0 Error:
Request for the permission of type
System.Security.Permissions.SecurityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed.

The doco for Nunit see:
http://nant.sourceforge.net/help/tasks/nunit2.html, suggests that I
have a the following added to test config file.

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="nunit.framework"
publicKeyToken="96d09a1eb7f44a77" culture="Neutral" />
<bindingRedirect oldVersion="2.0.6.0" newVersion="2.1.4.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

I'm not sure where this would go as I am trying to test a class
library which would not have a config but I created one anyway and
called it as follows:

<target name="test">
<property name='include.tests' value='true' />

<call target='build' />

<nunit2>
<formatter type="Plain" />
<test assemblyname="${bld.dir}/${project.file}"
appconfig="C:\_ApplicationsVS\Mf\Mf.dll.config" />
</nunit2>

</target>

<target name='build'>
<call target='clean'/>
<call target='compile'/>
</target>

<target name="compile">

<!-- dependencies -->
<copy todir="${bld.dir}" if='${isLog4net}' > <fileset
basedir="${commons.dir}\log4net\" > <includes name="*.dll" />
</fileset> </copy>
<copy todir="${bld.dir}" if='${isNUnit}' > <fileset
basedir="${commons.dir}\nunit\" > <includes name="*.dll" />
</fileset> </copy>

<!-- compile -->
<csc target="${project.target}"
output="${bld.dir}/${project.file}"
debug="${debug}">

<references>
<includes name="${bld.dir}/*.dll" />
</references>

<resources>
<includes name="**/*.resx" />
</resources>

<sources basedir="${src.dir}">
<includes name="**/*.cs" />
<excludes name="_Test/**" unless='${include.tests}'/>
</sources>
</csc>
</target>

I still get the error, can anyone help.

Cheers Dave
Nov 15 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I am just getting into NAnt, so this may be off base. This is most likely
the config file for NAnt and not for the class you are setting up an
automated build and test for.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"muesliflakes" <mu**********@yahoo.com.au> wrote in message
news:8d**************************@posting.google.c om...
I am trying to run nunit2 from nant and get the following error:

NUnit 2.0 Error:
Request for the permission of type
System.Security.Permissions.SecurityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed.

The doco for Nunit see:
http://nant.sourceforge.net/help/tasks/nunit2.html, suggests that I
have a the following added to test config file.

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="nunit.framework"
publicKeyToken="96d09a1eb7f44a77" culture="Neutral" />
<bindingRedirect oldVersion="2.0.6.0" newVersion="2.1.4.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

I'm not sure where this would go as I am trying to test a class
library which would not have a config but I created one anyway and
called it as follows:

<target name="test">
<property name='include.tests' value='true' />

<call target='build' />

<nunit2>
<formatter type="Plain" />
<test assemblyname="${bld.dir}/${project.file}"
appconfig="C:\_ApplicationsVS\Mf\Mf.dll.config" />
</nunit2>

</target>

<target name='build'>
<call target='clean'/>
<call target='compile'/>
</target>

<target name="compile">

<!-- dependencies -->
<copy todir="${bld.dir}" if='${isLog4net}' > <fileset
basedir="${commons.dir}\log4net\" > <includes name="*.dll" />
</fileset> </copy>
<copy todir="${bld.dir}" if='${isNUnit}' > <fileset
basedir="${commons.dir}\nunit\" > <includes name="*.dll" />
</fileset> </copy>

<!-- compile -->
<csc target="${project.target}"
output="${bld.dir}/${project.file}"
debug="${debug}">

<references>
<includes name="${bld.dir}/*.dll" />
</references>

<resources>
<includes name="**/*.resx" />
</resources>

<sources basedir="${src.dir}">
<includes name="**/*.cs" />
<excludes name="_Test/**" unless='${include.tests}'/>
</sources>
</csc>
</target>

I still get the error, can anyone help.

Cheers Dave

Nov 15 '05 #2

P: n/a
D C
I just tried putting those configuration settings in NAnt.exe.config and
still not working.

I've tried putting the config settings into config files for
Nant.exe.config, nunit-console.exe.1.1.config, nunit-gui.exe.1.1.config,
nunit.tests.dll.1.1.config as well as my own Mf.dll.config and get this
error each time.

Dave...

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #3

P: n/a
This seems like NUnit does not have the necessary permissions to run. Are
you running NUnit perhaps from a network share? If so, then it is running
under limit security context.

Sami
Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.