开发者

nunit network drive, failing to load tests

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 th开发者_StackOverflow社区is is being caused, and how I can carry on using a network drive for development.


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 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜