Need help in running NCover with NUnit

Need help in running NCover with NUnit

Hi,

 

I am using NCover to run coverage for my project (c# library). But I am not getting the coverage done properly. When I checked the nunit output file, I found the following entry for almost all the test cases.

 

 <test-case name=" TestCaseForResultStatus" executed="True" success="False" time="1.125" asserts="0">- <failure>- <message>

 

- <![CDATA[ System.InvalidOperationException : Unable to generate a temporary class (result=1).

 

error CS0647: Error emitting 'System.Security.Permissions.PermissionSetAttribute' attribute -- 'Unexpected exception processing attribute -- System.ArgumentException: Unable to generate permission set; input XML may be malformed..'

error CS0647: Error emitting 'System.Security.Permissions.PermissionSetAttribute' attribute -- 'Unexpected exception processing attribute -- System.ArgumentException: Unable to generate permission set; input XML may be malformed..'

  ]]>

 

  </message>

 

- <stack-trace>

 

- <![CDATA[

 

   at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, CompilerParameters parameters, Evidence evidence)

   at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, CompilerParameters parameters, Assembly assembly, Hashtable assemblies)

   at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)

   at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace)

   at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)

   at System.Xml.Serialization.XmlSerializer..ctor(Type type)

   at UnitTest.ResultStatusCodeUnitTest.TestCaseForResultStatus() in C:\UnitTest\Common\ResultStatusCodeUnitTest.cs:line 45

  ]]>

 

  </stack-trace>

 

  </failure>

 

  </test-case>

 

When we run the Nunit from the console it is working fine and all the test cases are executed. The problem happens only when we use NCover.

Can anyone help on this?          

 

Thanks & Regards

Guhan

 


Try NCover Free Contact Us Online