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

Notification

Icon
Error

extern alias throwing exception
YalexK
#1 Posted : Wednesday, March 22, 2017 8:28:01 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/22/2017(UTC)
Posts: 5
Location: United States of America

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.
Remco
#2 Posted : Wednesday, March 22, 2017 10:03:56 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 960 times
Was thanked: 1290 time(s) in 1196 post(s)
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.
YalexK
#3 Posted : Thursday, March 23, 2017 4:32:52 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/22/2017(UTC)
Posts: 5
Location: United States of America

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
Remco
#4 Posted : Thursday, March 23, 2017 10:18:15 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 960 times
Was thanked: 1290 time(s) in 1196 post(s)
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.
YalexK
#5 Posted : Friday, March 24, 2017 1:30:04 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/22/2017(UTC)
Posts: 5
Location: United States of America

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!
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.039 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download