Build/Test Issues

extern alias throwing exception

Started by YalexK on 5,088 views

I have visual studio 2015 and ncrunch is breaking in extern alias. Im aware of NCrunch Forums but I have NCrunch 3.2.0.3 and am still having issues with the project building.
Hi, thanks for sharing this problem.

There haven't been any changes around extern aliases in NCrunch for quite some time. Most likely this hasn't been solved in a version newer than what you're using.

Are you able to reproduce this problem in a project sample that you can share with me? NCrunch does try to preserve extern aliases when it reworks project references, but it's possible there's something it's missing here in your use case.
Hi,
First off, I’d just like to say that you are awesome! I love NCruch and the fact that you’re still answering on these forums for every question (even when admittedly they are not well explained =) ) is amazing.
(See http://imgur.com/a/pxGZ6 for images)
I figured out the issue. Someone wanted to add 2 dlls with the same name into the project. In order to do this without renaming one of them, they renamed the reference in the Csproj (Image #2). At that point they were able to add the other dll and place an alias on it. MSBuild works in this case but for some reason NCrunch does not.
Thank You
Thanks for sharing these extra details. Looking at the way these references are declared, I think I can understand why NCrunch might have problems here. NCrunch doesn't consider the alias when attempting to uniquely identify the reference, so it's most likely getting them confused.

Although it's a goal to make NCrunch try and support edge cases like this, I do have some reservations about handling this one specifically. Mostly this is because my own experiences have shown that trying to have two different assemblies loaded into the same application domain under the same name tends to cause massive problems in the CLR. Is there a strict requirement that your dependencies be arranged like this? If at all possible, I would suggest renaming one of the DLLs to avoid tooling and runtime issues.
Completely understand. I'm a relatively junior programmer and its a rather large code base so I dunno if I'll be able to rename a dll but I can definitely alter it on my local. Thank you!

Post a reply

Log in to reply.