473,320 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Nant - Nunit2 configuration

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
3 4749
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: HaukiDog | last post by:
Hi, I am trying to set up my C# web project to be compiled by NANT. Everything compiles and works fine within the IDE. I have a created a NANT build file which has a simple project tag, like...
0
by: muesliflakes | last post by:
I have figured out how to get this running by using Ant.Console as a starting point for calling NAnt. I had to include NAnt.Core, NAnt.DotNet & NDoc.Core in my project and it worked correctly. ...
0
by: Andy | last post by:
Hi all, I'm having a problem with a Nant NUnit2 task. I'm testing an assembly which depends on another assembly, located in a standard location. I'm trying to use the <assemblies><lib...
2
by: Ireneus Broncel | last post by:
Maybe I am wrong here, but I have a problem with nant that I don't unterstand, I'm trying to compile an example ConsoleApp Project with net-1.1, and get the errror: log4net:ERROR LogLog:...
3
by: prabhupr | last post by:
Hi Folks Not sure if this is the right group, if not please re-direct me to the right one. Here is my question =============== When I compile my ASP.NET WEB project from VS 2005 (.NET...
2
by: eric.patterson | last post by:
I am trying to setup an automatic build using nant. I am using the nunit2 task to run my unit tests after the build. I then want to take the nunit results xml file and produce a html page using...
1
by: sireesha.parvatham | last post by:
Hi, Can somebody help me please. I am a learner using NAnt build files for my ASP.NET web applications. It works fine for .cs files, but when i try to use .aspx files, it gives me an error. The...
1
by: Spam Catcher | last post by:
Hello Everyone, I just started using nant in conjunction with cruisecontrol.net. The <solutiontag has been great in helping us compile VS.NET 2003 projects without need to write a nant build...
0
by: Curtin1060 | last post by:
Hi, I have a simple exe.config issue where I'd like to swap out the config file with NAnt/XMLPOKE. I just can't figure out the correct xpath to get to the "file=" attribute. I want to swap in...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.