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

Notification

Icon
Error

NCrunch will not build when the specflow.targets is on a different drive then the solution is
arjan
#1 Posted : Wednesday, October 21, 2015 8:40:33 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/21/2015(UTC)
Posts: 3
Location: Netherlands

Thanks: 1 times
Hi,

We have a NuGet setup that puts all the NuGet packages in "C:\LocalNuGetRepository" instead of the "packages" folder in the solution folder.
Unfortunately I have no influence in changing this.

Now when I try to run NCrunch on test that are created using SpecFlow, then I see the following error occuring:
Quote:
System.IO.IOException: Path 'C:\LocalNuGetRepository\SpecFlow.1.9.0\tools\TechTalk.SpecFlow.targets' is on a different drive from 'D:\Build\<SolutionPath>\<SpecFlowTestProjectFolder>'
at nCrunch.Common.IO.PathHelper.MakeAbsolutePathRelative(String absolutePathToMakeRelative, String relativeToAbsoluteDir)
at nCrunch.Client.ComponentLoader.SnapshotComponentFactory.()
at nCrunch.Client.ComponentLoader.SnapshotComponentFactory.(ProcessorArchitecture )
at nCrunch.Client.ComponentLoader.SnapshotComponentFactory.CreateSnapshotComponentFromXml(FilePath projectFilePath, BuildXml projectXml, FilePath solutionFilePath, String[] additionalFilesToIncludeAtSolutionLevel, Boolean isLoadedFromFile, ISnapshotConfig snapshotConfig, VisualStudioVersion vsVersion)


Is there a way that I can tell NCrunch that this path is never going to be relative and that NCrunch should change the destination to something that it can use?

Thanks in advance!

Kind regards,
Arjan
Remco
#2 Posted : Wednesday, October 21, 2015 10:05:37 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Arjan,

Thanks for sharing this issue.

Unfortunately, this is a bit of a showstopping problem for NCrunch. NCrunch works by creating virtual structures that mirror the structure of your solution. This lets it move projects around and work with them independently. The code usually continues to work, because of the use of relative path references. This whole approach just doesn't work for absolute file references - see http://www.ncrunch.net/documentation/considerations-and-constraints_absolute-file-references for more information.

You've mentioned that it is outside of your control to move the nuget repository to a different place. What about moving your solution to C: drive? Is this an option?
1 user thanked Remco for this useful post.
arjan on 10/22/2015(UTC)
arjan
#3 Posted : Thursday, October 22, 2015 9:44:44 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/21/2015(UTC)
Posts: 3
Location: Netherlands

Thanks: 1 times
Hi Remco,

Thanks for the quick reply!
Unfortunately moving the solution to the C:\ drive also isn't an option at the moment.
There are too many absolute path references that our testers are using (working on removing them :)).

Hopefully in the future we get rid of those ridiculous absolute references and I will be happy using NCrunch! :)

I did read the link that you posted, but I was hoping that it only couldn't work with absolute file paths in my code and that targets that are on other drives would be resolved and the target location would be updated in the project.
It does seem to do something similar for the references? Those also reside in the C:\LocalNuGetRepository, but work oke in the NCrunch build.

It would be cool that a user could say, oke I've got this weird setup with my NuGet... this is my original location, but you can treat it as a relative packages path. And in the project file change those locations. (Don't know if I'm suggesting something awful here or not?)
Remco
#4 Posted : Thursday, October 22, 2015 10:26:51 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
arjan;7874 wrote:

I did read the link that you posted, but I was hoping that it only couldn't work with absolute file paths in my code and that targets that are on other drives would be resolved and the target location would be updated in the project.
It does seem to do something similar for the references? Those also reside in the C:\LocalNuGetRepository, but work oke in the NCrunch build.

It would be cool that a user could say, oke I've got this weird setup with my NuGet... this is my original location, but you can treat it as a relative packages path. And in the project file change those locations. (Don't know if I'm suggesting something awful here or not?)


The problem in this case has more to do with the cross-drive issue. There are features in NCrunch that do require a solution (with its references) to be a fully relocatable unit. NCrunch cannot reliably identify all the absolute paths in a solution, so it has no way of providing meaningful errors when things downstream in the engine fail. The check that is failing for you at the moment is intended to prevent some very weird things happening in the engine later in the run.

It's true that NCrunch does have some limited logic for relocating referenced assemblies into workspaces, but this does tend to fall short in the area of some Nuget packages which have their own build steps etc. I realise this may not apply to your case, but this is the way the engine has been designed to try and give people the most predictable behaviour.

So I'm sorry, but unless you can move either the solution or the Nuget packages, I don't see a way we can make this work for you :(
arjan
#5 Posted : Friday, October 23, 2015 5:46:45 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/21/2015(UTC)
Posts: 3
Location: Netherlands

Thanks: 1 times
Thank you for your answers!
All the more reason for us to fix our fixed location issues! ;-).
vandop
#6 Posted : Wednesday, May 25, 2016 1:41:08 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/25/2016(UTC)
Posts: 1
Location: Norway

arjan;7877 wrote:
Thank you for your answers!
All the more reason for us to fix our fixed location issues! ;-).



Wouldn't a Symbolic link trick NCrunch into believing it was actually in the right folder?

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