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