Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Have InvalidCastException when build test projects with NCrunch
Xinyu
#1 Posted : Friday, March 24, 2023 7:13:37 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/24/2023(UTC)
Posts: 2
Location: China

Hi,

One of my projects fail to build in NCrunch Processing Queue and here is the error I'm getting:

[PID:37092 14:43:57.3071 LocalBuildTask-24] ERROR: System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Object[]'.
at nCrunch.Module.MSTest.Integration.MSTestCilResolvedParameters..ctor(CilCustomAttribute dataRowAttribute)
at nCrunch.Module.MSTest.Integration.MSTestCilDiscoverer.createTestCases(CilMethodDefinition method, CilTypeDefinition fixture)
at nCrunch.Module.MSTest.Integration.MSTestCilDiscoverer.<FindFrameworkTestsInAssembly>b__12_0()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Module.MSTest.Integration.MSTestCilDiscoverer.FindFrameworkTestsInAssembly(ReflectedAssembly assembly, FilePath assemblyFilePath, IList`1 referencedAssemblyFilePaths, ComponentUniqueName testComponentUniqueName, PlatformType platformType, DynamicProxy[] dynamicProxies)
at nCrunch.TestExecution.TestFinder..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.TestExecution.TestFinder..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActi

A string is mistakenly converted to object[] somewhere, but I cannot find where the issue might be. My project builds and runs well using Visual Studio. Is it an NCrunch internal error? Can anyone give some advice?

Thanks,
Xinyu.
Remco
#2 Posted : Friday, March 24, 2023 11:25:11 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for posting. Can you confirm whether you are running the latest version of NCrunch? There was a breaking change in MSTest a few months ago that was causing issues like this one.
Xinyu
#3 Posted : Thursday, March 30, 2023 5:21:45 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/24/2023(UTC)
Posts: 2
Location: China

Hi,

Thanks for answering. I'm not using the newest version. I'm using 4.11. Unfortunately we only have license for 4.11. Then that's the reason.
Remco
#4 Posted : Thursday, March 30, 2023 11:10:57 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Xinyu;16566 wrote:
Hi,

Thanks for answering. I'm not using the newest version. I'm using 4.11. Unfortunately we only have license for 4.11. Then that's the reason.


Sorry, to resolve this issue you'll either need to roll back to an earlier version of MSTest, or upgrade your NCrunch. The version of NCrunch you're using wasn't designed to run on the version of the MSTest framework binary that you're referencing (they broke the API and we had to fix it in a later version).
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.033 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download