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

Notification

Icon
Error

Build fail when using var = dynamic
markrendle
#1 Posted : Tuesday, June 12, 2012 9:59:55 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/12/2012(UTC)
Posts: 4

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Bit of a showstopper for me, this. I've got 700 tests using a dynamic type but with the var keyword. Builds fine in VS and MonoDevelop, but not in NCrunch, which is treating the "dynamic" as "object". I suspect this is a known issue, but until it's fixed, I can't use NCrunch.
Remco
#2 Posted : Tuesday, June 12, 2012 10:24:33 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Mark,

Thanks for posting! I have heard reports of this problem although I've yet to be able to get my hands on a test solution that can reproduce the problem. Is there any chance you could send through to me a solution that can do this?


Cheers,

Remco
GraemeBradbury
#3 Posted : Wednesday, June 13, 2012 7:21:45 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/13/2012(UTC)
Posts: 1

Mark's talking about his Simple.Web project.

The git repository is: https://github.com/markrendle/Simple.Web.git
Remco
#4 Posted : Wednesday, June 13, 2012 7:32:06 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Excellent thank you!
Remco
#5 Posted : Wednesday, June 13, 2012 7:43:18 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
I've just given this solution a spin. Unfortunately it didn't produce the problem described (all tests passed for me with one exception, which looked like an unrelated issue). I wonder if there may be something about this issue that's system related. Graeme - does the issue also occur for you?
markrendle
#6 Posted : Wednesday, June 13, 2012 11:04:06 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/12/2012(UTC)
Posts: 4

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Hi Remco,

It's not Simple.Web, it's Simple.Data that has the problems. http://github.com/markrendle/Simple.Data

Cheers,
Mark
Remco
#7 Posted : Thursday, June 14, 2012 12:08:26 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Mark,

Thanks for posting the link to your solution. With this information, I've been able to isolate the issue and I can confirm that a fix will be in the 1.40b release due out in a few days time. Meanwhile I can suggest a couple of workarounds:

1. Add a parameter to each of the problematic methods that are returning a dynamic type. The parameter can be completely unused, but it will cause NCrunch's instrumention to work along a different code path and will prevent it from corrupting the assembly.
2. Turn off the NCrunch 'Instrument Output Assembly' configuration option for any projects containing problematic methods. This will also disable code coverage reporting for these projects.

It's somewhat surprising for me that this issue has existed for so long. I guess not too many people are writing parameterless methods that return dynamic types across assembly boundaries.


Cheers,

Remco
1 user thanked Remco for this useful post.
markrendle on 6/15/2012(UTC)
markrendle
#8 Posted : Sunday, June 17, 2012 10:22:55 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/12/2012(UTC)
Posts: 4

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
I think Simple.Data's Database.Open may be the only one. But more and more people are using it!

Looking forward to 1.40. NCrunch is like crack; I'm missing my hits.
1 user thanked markrendle for this useful post.
Remco on 6/17/2012(UTC)
Remco
#9 Posted : Tuesday, June 19, 2012 4:28:06 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
For anyone interested, 1.40b has just been released including a fix for the above issue. Thanks again for the help in examining this problem.
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.063 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download