Exception when generating report using MSBuild

Exception when generating report using MSBuild

I'm getting following exception when when generating report using MSBuild and CC.NET

Any idea? Why it's giving InvalidCastException


error code="MSB4018" message="The "NCoverReporting" task failed unexpectedly. System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidCastException: [A]NCover.Framework.Reports.CoverageReportSetting cannot be cast to [B]NCover.Framework.Reports.CoverageReportSetting. Type A originates from 'NCover.MSBuildTasks, Version=3.4.2.6735, Culture=neutral, PublicKeyToken=null' in the context 'LoadFrom' at location 'C:\Program Files\NCover\Build Task Plugins\NCover.MSBuildTasks.dll'. Type B originates from 'NCover.MSBuildTasks, Version=3.4.2.6735, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'C:\Windows\Microsoft.NET\Framework\v3.5\NCover.MSBuildTasks.dll'. at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterCoverageReportSetting.Write17_CoverageReportSetting(Object o) --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id) at System.Xml.Serialization.XmlSerializer.Serialize(Stream stream, Object o, XmlSerializerNamespaces namespaces) at System.Xml.Serialization.XmlSerializer.Serialize(Stream stream, Object o) at NCover.Framework.Reports.CoverageReportSetting.SaveToStream(Stream stream) at NCover.Framework.Reports.CoverageReportSetting.SaveToFile(String fileName) at NCover.MSBuildTasks.NCoverReporting.GenerateCommandLineCommands() at Microsoft.Build.Utilities.ToolTask.Execute() at NCover.MSBuildTasks.NCoverReporting.Execute() at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)" dir="C:\Program Files\CruiseControl.NET\server\ConsumerWeb4.0\WorkingDirectory\Build" name="ConsumerWeb4.MSBuild.xml" pos="(84, 3)" />


RE: Exception when generating report using MSBuild

Can you post the NCoverReporting task source and any other settings from your MSBuild script that might affect the execution of the task (PropertyGroups, etc). Also, if you're using a settings file, include that.

Our forum gets a bit messy when pasting lots of code, so you may want to put that code into http://gist.github.com and then post the link to it here, or if you would like, you could email that information to support@ncover.com instead.