tags:

views:

114

answers:

1

We currently carry out development on a mapped drive. When I write nunit tests against a test assembly it will pick up the assembly, however does not recognise any of the tests.

If I move the solultion etc to a local drive and reference it again then everything works fine.

What I really woiuld like to know is why this is being caused, and how I can carry on using a network drive for development.

A: 

Per http://geekswithblogs.net/TimH/archive/2007/08/02/114340.aspx, NUnit apparently does not have appropriate permissions to access the assembly when on a network drive. The suggested fix is to add a post-build event to copy the assembly to a local temp directory and run NUnit off that copied assembly:

  1. Within VS, open the project properties.
  2. Go to the Build Events tab and enter the following 'Post-build event command line':

    del /q c:\temp\nunit*.*

    copy "$(TargetDir)." c:\temp\nunit

A potential issue you may have as a result of this change is related to the AppBase as per http://stackoverflow.com/questions/424798/unable-to-load-mytest-because-it-is-not-located-under-appbase. The answer there is to update the Settings element within the .nunit file to include an app base of C:\Temp\NUnit then update the assembly element's path to remove any leading directory information.

David Beckman