Build/Test Issues

Build fails under VS 2015 RTM, seems to be using old files/assemblies?

Started by lassevk on 5,544 views

I have this interface:

public interface IDiffMatchAligner<T>
{
[NotNull]
IEnumerable<DiffElement<T>> Align(Slice<T> slice1, Slice<T> slice2);
}

At some point, the Slice<T> types there were IList<T>, but have subsequently been replaced everywhere.

Build of this class library fails with this error message:

BasicInsertDeleteDiffMatchAligner.cs (7, 57): 'BasicInsertDeleteDiffMatchAligner<T>' does not implement interface member 'IDiffMatchAligner<T>.Align(IList<T>, IList<T>)'

Here is the class definition that it complains about:

public class BasicInsertDeleteDiffMatchAligner<T> : IDiffMatchAligner<T>
{
[NotNull]
public virtual IEnumerable<DiffElement<T>> Align(Slice<T> slice1, Slice<T> slice2) =>
slice1.Select(element => new DiffElement<T>(element, new Option<T>(), DiffOperation.Delete))
.Concat(slice2.Select(element => new DiffElement<T>(new Option<T>(), element, DiffOperation.Insert)));
}

I had this problem once earlier (exact same error, files exactly as above) and fixed it by hitting "Reload and rebuild selected component" on the assembly in the ncrunch tests pane, but now can't seem to shake this problem.
Hi,

Thanks for sharing this issue.

There is a massive range of things that can cause an issue like this, so I'm afraid I need to ask quite a few questions to try and narrow this down. I'm not sure if you're able to answer them all, but each one will help:

- Do you receive any build warnings that go with this error?
- Try setting your 'Log Verbosity' global configuration setting to 'Detailed', then rebuild this project. Go to the processing queue, then click on the failed build. Does the build log give you any interesting information about the problem? Look particularly closely at the assemblies being referenced and any warnings given about resolution issues
- Are you able to reproduce the problem in a narrower scope (for example, in a dummy solution?)
- Are the interface declaration and class declaration situated in different projects? If so, what happens if you move them together?
- Do you notice any difference if you run NCrunch under compatibility mode? http://www.ncrunch.net/documentation/troubleshooting_compatibility-mode
- Was there anything specific that seemed to trigger the issue to start appearing consistently? Perhaps a code change or change in your environment? (i.e. upgrade of VS2015)
No build warnings, the project builds and runs all unit tests successfully using ReSharper unit-test runner.

Unfortunately the build issue rectified itself because I managed to change the interface definition by a linefeed to it, this seems to have forced a refresh of the offending file and now everything builds. Good for my progress, but sucks for troubleshooting and figuring out if this is a bug in NCrunch or something else.

Not been able to reproduce it forcibly. I did that earlier but no matter what I did everything worked nicely in that project.

All the classes and interfaces are in one project, all the unit-tests in another. The interface and the class is in the same project.

This has only happened in VS 2015.
I am aware of a problem in which NCrunch can get out of sync with VS document windows under certain circumstances. Making a change to the offending document will always correct the issue immediately. As I've never been able to reproduce the issue consistently enough to understand it, no path to a fix exists. The problem is very rare and always disappears between sessions of NCrunch or VS. It seems to be more common when performing large refactorings (particularly automated ones like those in ReSharper).

My theory is that there is a race condition somewhere in the text buffering of the VS documents and the way that NCrunch retrieves this data. But I have no proof of this. As far as I know, it affects all versions of VS/NCrunch.

Post a reply

Log in to reply.