Started using NCrunch on a new C# project today and saw an error:
NCrunch is failing to build the module with the following error:
Controls\TestFooCodeBehind.cs (81): 'MyNamespace.Common.EntityMapping.EntityMapper' does not contain a constructor that takes 2 arguments
EntityMapper indeed has only a single constructor, which takes three arguments:
public EntityMapper(Session session, IServiceProxy service, ITracingService tracingService) {/* code */}
However, the call on line 81 of TestFooCodeBehind.cs actually has three parameters in it, not two as NCrunch states: (note: I added line numbers to the front of each line)
78 backgroundWindow.DoWork += delegate
79 {
80
81 var mapper = new EntityMapper(session,
82 Authentication.CurrentSession, null);
Visual Studio is able to compile without issue, there are no overloads of the constructor or any optional params, and EntityMapper does not have any base classes or implement any interfaces.
However, when I removed the line break, combining line 81 and 82 into a single line, the error went away. Putting the line break back did not cause the error to return.
I'm running NCrunch v1.38.0.17b in VS 2010 Premium v4.0.30319 SP1Rel
Build/Test Issues
NCrunch complains about constructor param count, but has wrong count
Started by johnmwright on 5,856 views
Remco NCrunch Developer
#1730
24 Apr 2012 22:08 UTC
Hi John,
I suspect this is caused by the same issue you've highlighted in your other thread - http://forum.ncrunch.net/yaf_postst339_Build-failure---no-space-before-base-class.aspx
When you experience this issue, is it generally between classes that are being referenced across project/assembly boundaries?
I suspect this is caused by the same issue you've highlighted in your other thread - http://forum.ncrunch.net/yaf_postst339_Build-failure---no-space-before-base-class.aspx
When you experience this issue, is it generally between classes that are being referenced across project/assembly boundaries?
For this specific case, the class which is failing to compile (TestFooCodeBehind) is in a different project/assembly than the EntityMapper class. Unlike the items I mentioned in the other thread, I haven't seen this one reoccur, but it does seem related. If it does happen again, I'll submit a bug report via the NCrunch menu and update this post.
Post a reply
Log in to reply.