Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all articles
Browse latest Browse all 3509

Unit tests fail to queue

$
0
0

*** UPDATE: worked around issue by shutting down Visual Studio, opening a command prompt, then issuing the command: caspol -reset ***

Sorry if this post is not in the correct section, did not see a section that looked like a dead ringer for where this post should be placed.

We have recently implemented a rather extensive library of unit test for our systems.  As we were authoring the unit tests we had our assemblies building using the Debug configuration.  The unit tests ran fine.  During the development cycle we changed the configuration to Release, re-built and again the tests ran fine.  This is where things got wierd.  When we reverted the build configuration back to Debug, all of the tests now fail to queue.  The error reported is: "Failed to queue test run'user@machine 2009-09-11 08:55:12': Invalid syntax.".  The calls stack indicates some sort of Code Access Security issue:

   System.Security.XmlSyntaxException: Invalid syntax.
   at System.Security.SecurityDocument.GetTagForElement(Int32 position)
   at System.Security.Policy.PolicyStatement.FromXml(SecurityDocument doc, Int32 position, PolicyLevel level, Boolean allowInternalOnly)
   at System.Security.Policy.PolicyLevel.CheckCache(Int32 count, Char[] serializedEvidence)
   at System.Security.Policy.PolicyLevel.Resolve(Evidence evidence, Int32 count, Char[] serializedEvidence)
   at System.Security.PolicyManager.CodeGroupResolve(Evidence evidence, Boolean systemPolicy)
   at System.Security.PolicyManager.ResolveHelper(Evidence evidence)
   at System.Security.HostSecurityManager.ResolvePolicy(Evidence evidence)
   at System.Security.PolicyManager.Resolve(Evidence evidence)
   at System.Security.SecurityManager.ResolvePolicy(Evidence evidence)
   at Microsoft.VisualStudio.TestTools.Common.FileHelper.IsTrustedForLocalExecution(String path)
   at Microsoft.VisualStudio.TestTools.TestManagement.DeploymentHelper.IsTrustedForLocalExecution(String path, TestRunConfiguration runConfig, String& untrustedFile)
   at Microsoft.VisualStudio.TestTools.TestManagement.DeploymentHelper.IsDeploymentFromUntrustedLocation(TestRunConfiguration runConfig, List`1 tests, List`1 dependencies, DeploymentItemCollection perTestDeploymentItems, String& firstUntrustedFile)
   at Microsoft.VisualStudio.TestTools.TestManagement.DeploymentManager.DoDeployment(TestRun run, FileCopyService fileCopyService)
   at Microsoft.VisualStudio.TestTools.TestManagement.ControllerProxy.SetupTestRun(TestRun run, Boolean isNewTestRun, FileCopyService& fileCopyService)
   at Microsoft.VisualStudio.TestTools.TestManagement.ControllerProxy.QueueTestRunWorker(Object state)

We cannot get these tests to run on this buildI have found some Microsoft KB articles talking about unit tests and test failures.  The steps detailed in these articles do not resolve this issue.  I think this may only happen when working with strongly named assemblies, we have not validated this statement at this time though.

Anyone have any insight as to what might be going on here?  We have already created a new test project (With a different name), reset the CAS settings using CASPOL, creating a new .vsmdi file, creating a new localtestrun.config file, cleaning the solution, and deleting all bin and obj folders then rebuilding to no avail.  Any advice is greatly appreciated.


Viewing all articles
Browse latest Browse all 3509

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>