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

Notification

Icon
Error

NCrunch Console Invalid Cast
simongh
#1 Posted : Friday, October 5, 2018 10:57:47 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/20/2017(UTC)
Posts: 26
Location: United Kingdom

I've just upgraded our Teamcity to use the 3.21 release of the console tool and we're getting the below error:

System.InvalidCastException: [A] cannot be cast to [B] . Type A originates from 'nCrunch.VSAddIn, Version=3.21.0.6, Culture=neutral, PublicKeyToken=01d101bf6f3e0aea' in the context 'Default' at location 'C:\BuildAgent\tools\NCrunch_Console_3.21.0.6\nCrunch.VSAddIn.dll'. Type B originates from 'NCrunch, Version=3.21.0.6, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'C:\BuildAgent\tools\NCrunch_Console_3.21.0.6\ncrunch.exe'.
at nCrunch.Common.ServiceLocator.FetchInstance[T](Boolean throwOnMissingService)
at ..ctor()
at ..ctor(Boolean )
at . ( , ILogWriter , , String , Nullable`1 )
at . (String[] )

I've had to roll back to 3.20 release. Thought this might be helpful.

We use the zip file release pushed out to the build agents automatically by the build server.
Remco
#2 Posted : Friday, October 5, 2018 11:28:39 AM(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 sharing this problem.

I've just double-checked the ZIP download for v3.21 of the NCrunch Console tool. I could not reproduce this problem.

By chance, do you have a directory comparison tool like Kdiff3 available? It would be interesting to perform a comparison of the ZIP file from the NCrunch download page with the contents of your C:\BuildAgent\tools\NCrunch_Console_3.21.0.6 directory. I wonder if there is a difference there somewhere.
simongh
#3 Posted : Friday, October 5, 2018 12:42:09 PM(UTC)
Rank: Member

Groups: Registered
Joined: 10/20/2017(UTC)
Posts: 26
Location: United Kingdom

Using winmerge. Everything comes back as identical. We're using TeamCity Professional 2018.1.1 (build 58406) triggering ncrunch from a commandline
Remco
#4 Posted : Friday, October 5, 2018 9:36:34 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)
I have a feeling there is an environmental component to this. Can you check if you can use the same version of the console tool on the same solution on any of the other machines in your network? (i.e. a dev machine).

v3.21 of NCrunch was very limited in its functional changes. It includes no new assemblies or referencing changes over v3.20. If you haven't already, I do also recommend rebooting your build server to see if this makes any difference.
Kirlu
#5 Posted : Monday, October 8, 2018 9:22:25 AM(UTC)
Rank: Member

Groups: Registered
Joined: 6/8/2017(UTC)
Posts: 10
Location: Democratic Republic of the Congo

Was thanked: 2 time(s) in 2 post(s)
We are experiencing the same problem.
The problem can only be reproduced when running Ncrunch Console from TeamCity.

Running locally on buildserver either using cmd or powershell does not reproduce the error.
Remco
#6 Posted : Monday, October 8, 2018 10:19:58 AM(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)
Thanks, we'll try digging a bit more to see if we can get this to happen on our end. We'll let you know as soon as we have more information.
Kirlu
#7 Posted : Monday, October 8, 2018 10:39:48 AM(UTC)
Rank: Member

Groups: Registered
Joined: 6/8/2017(UTC)
Posts: 10
Location: Democratic Republic of the Congo

Was thanked: 2 time(s) in 2 post(s)
We have tried running the command as a run on the build server:
C:\Windows\system32\cmd.exe /c ""C:\Program Files (x86)\Remco Software\NCrunch Console Tool\NCrunch.exe" C:\TeamCity\buildAgent\work\89f512a38888334a\master.sln /c C:\TeamCity\buildAgent\work\89f512a38888334a\teamcity.crunch.v3.xml /e "TeamCity Continues Int"
Remco
#8 Posted : Monday, October 8, 2018 10:41:36 AM(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)
Thanks, can you confirm if you installed the console tool using the MSI or the ZIP?
Kirlu
#9 Posted : Monday, October 8, 2018 10:46:55 AM(UTC)
Rank: Member

Groups: Registered
Joined: 6/8/2017(UTC)
Posts: 10
Location: Democratic Republic of the Congo

Was thanked: 2 time(s) in 2 post(s)
We have confirmed that the error occurred both for the zip and msi.
1 user thanked Kirlu for this useful post.
Remco on 10/8/2018(UTC)
simongh
#10 Posted : Monday, October 8, 2018 11:01:27 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/20/2017(UTC)
Posts: 26
Location: United Kingdom

We use just zip deployment. We're currently using 15.7.5 of the build tools
Kirlu
#11 Posted : Monday, October 8, 2018 11:05:02 AM(UTC)
Rank: Member

Groups: Registered
Joined: 6/8/2017(UTC)
Posts: 10
Location: Democratic Republic of the Congo

Was thanked: 2 time(s) in 2 post(s)
Also running NCrunch using TeamCity powershell step also reproduces the error:
& 'C:\Program Files (x86)\Remco Software\NCrunch Console Tool\NCrunch.exe' .\master.sln /c .\teamcity.crunch.v3.xml /e "TeamCity Continues Integration" /o NCrunchResults /TeamCityDisableTestNotRunFailureReporting -LogVerbosity Summary
Remco
#12 Posted : Friday, October 12, 2018 3:13:46 AM(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)
Thanks for your patience with this issue. We've introduced a fix for this in the just released v3.22.
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.055 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download