Build/Test Issues

Build fails when Output folder contains drive letter

Started by bluesky on 5,195 views

Hi,

i have a similar issue as already stated in this post:
http://forum.ncrunch.net/yaf_postst1140_NCrunch-fails-to-build-when-reference-is-on-another-drive.aspx

but in my case its the output folder which uses a substed drive letter (e.g. R:\Domain), giving the following exception:

ERROR (Internal): System.NullReferenceException: Object reference not set to an instance of an object.
at nCrunch.Common.IO.DirectoryPath.GetNumberOfCommonDirectories(DirectoryPath path1, DirectoryPath path2)

I already submitted a bug report from within VS for the issue.

Thanks for your help!

Hi, thanks for sharing this issue! I saw the bug report come through a couple of hours ago and noticed the output path was the problem.

It's interesting that this worked for you in V1. I imagine it must have been quite unstable, as the output path pointing at an absolute path would have messed up NCrunch's workspace isolation.

I've made a note to improve NCrunch's handling of this situation. Probably the fix will work by automatically overriding the OutputPath to be a path relative to the project file when NCrunch is building the project.

To work around this issue, I suggest making the <OutputPath> build property conditional on the project not being built by NCrunch, for example:

<PropertyGroup>
<OutputPath Condition="$(NCrunch) != '1'">R:\Domain</OutputPath>
</PropertyGroup>

.. in this way, the output will always be contained within the workspace and the engine won't bug out.


Cheers,

Remco
Hi Remco,

thanks for the quick reply and the workaround. I will try that.

Bluesky

Post a reply

Log in to reply.