Running Nunit tests on network drives

The other day we came across a problem recently with Nunit accessing tests on network drives. As I'd like the code backed up I'd like to keep the tests and the code on the network drive.

The other day we came across a problem recently with Nunit accessing tests on network drives. As I'd like the code backed up I'd like to keep the tests and the code on the network drive. Nunit however refuses to read the tests from the network drive.

This appears to be happening because .NET is assigning intranet permissions to the network drive. So far the only solution I've found is to grant full permissions to the network drive using the following command:

c:>caspol -q -machine -addgroup 1 -url file://z:/* FullTrust -name "Z Drive"

NOTE: caspol.exe has to be in your path to work. Run it from your Visual Studio .NET Command Prompt.

Not ideal but fixes the problem for now. More information is available on www.sellsbrother.com. Documentation of caspol.exe is available from MSDN.

About the Author

Steve Temple, Technical Director and co-founder of Gibe

Steve is the super brain behind the development of our major projects. With over 20 years of commercial experience, Steve is an expert in .NET, Umbraco and Microsoft technologies. Steve is also an Umbraco Certified Master and Microsoft MCSD