Build/Test Issues

Build failure with extern alias

Started by rbirkby on 28,203 views

Hi,

When NCrunch attempts to build my NUnit test project, it fails with:

[11:38:38.157-BuildTask-11] Error 'Compilation': Project.Tests: Satisfyr\Satisfyr.NUnit.cs (34): The extern alias 'NUnitAlias' was not specified in a /reference option
Note that csc is called within VS with the following options:

/reference:..\..\lib\nunit.framework.dll /reference:NUnitAlias=..\..\lib\nunit.framework.dll

I don't think this situation is covered by the troubleshooting page: https://www.ncrunch.net/documentation/troubleshooting_project-build-issues


Regards,
Richard
Hi Richard -

You appear to be the first lucky person to use NCrunch against a project that uses referenced assembly aliases.

Up until now, I haven't been aware of this MSBuild feature (so it will need to be supported in an coming version of NCrunch)...

Meanwhile, is there a reason you need to alias the NUnit framework assembly? Are you perhaps using two different versions of NUnit?


Cheers,

Remco
Remco wrote:
Meanwhile, is there a reason you need to alias the NUnit framework assembly? Are you perhaps using two different versions of NUnit?


This is just the default Satisfyr library:
http://satisfyr.codeplex.com/
http://satisfyr.codeplex.com/SourceControl/changeset/view/1e4baea1b6a7#Satisfyr%2fSatisfyr.NUnit.cs


Richard
Thanks - I'll have a look to see what I can do about support for aliases in the next beta release build. I'm unable to try this at the moment, but does your project compile if you remove the 'extern' reference at the top of the Satisfyr source file along with the alias field on your NUnit assembly reference?
The newly released 1.31b adds support for MSBuild reference aliases, so this issue should now be resolved.
I've just encountered this problem in my build. I'm using NCrunch 1.32.0.0b, and one of my projects reports "The extern alias 'PromptLic' was not specified in a /reference option" in NCrunch's log. This project was working successfully with NCrunch until I needed to add the reference alias.

[edited to add] I just wanted to add my congratulations for creating such an awesome tool!

Regards,
Mike Upton

Edited

Hi Mike,

Thanks for checking in! There is a known problem with v1.32b where reference aliases don't seem to work properly for project references (although they have been fixed for static assembly references). A fix for this has been introduced in 1.33b which is pending release very soon.

Is the PromptLic reference in your solution pointing towards a project or an assembly? If it's the later, I'd be interested in checking out your log file to see what's happening (you can submit a bug report containing the log file using the option in the NCrunch menu).

I'm glad you like the tool :)


Cheers,

Remco
Hi Remco,

There are two assembly references given that alias. I've submitted a bug report as requested - hope it's helpful!
For anyone interested, this issue should be fixed in the recently released 1.33b.
I've just installed NCrunch 1.33b, and I'm afraid that the problem still remains for me. I've submitted another bug report, in case the log file from the latest version is more useful.
Hi Mike -

Thanks! I just saw your bug report go through ... will take a look.
After some investigation, it seems that 1.33b has a defect where assembly reference aliases that are used multiple times within the same project can cause builds to fail.

I've introduced a fix for this in 1.34b (released today).
Hi Remco,

Just wanted to let you know that I've finally had a chance to install 1.34b, and the problem is fixed for me!

Now to get on with improving my test coverage ;-)

Thanks,

Mike

Post a reply

Log in to reply.