Wednesday, September 16, 2009

Not able to run UnitTest cases when you open your project from shared location ?

Hi All,

I am using Integrated Unit Testing framework of Visual Studio 2008 (i.e. Microsoft.VisualStudio.QualityTools.UnitTestFramework). Recently I faced this issue(in heading/subject) when I opened my project from a dynamic view of clearacse(basically a shared drive)

The actual error which I got was: UTA057: The test 'XXX' cannot be executed because the assembly 'XXX.dll' is not fully trusted by .NET Framework Security Policy. Please use a local directory as the deployment directory for the test run, or use the .NET Framework Configuration tool to grant this assembly the Full Trust permission, and then try again.

The project I was testing is a class library and quick solution for this problem which I got is to uncheck the ENABLE DEPLOYMENT checkbox in LocalTestRun.testrunconfig.

If you don’t want to open this file in VS2008 then you can directly open the file in notepad add following tag <Deployment enabled="false" /> . By default deployment is enabled and the line mentioned above does not exist in this file.

I still need to check that what is the usage of enabling Deployment in this context. If you have used it then do send me comments.

But for now Happy Unit Testing and better development :)

| Anugrah Atreya

1 comment:

Anugrah A said...

See this link for complete solution