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

Notification

Icon
Error

NCrunch fails when building certain assemblies: PathTooLongException
mfjerome
#1 Posted : Wednesday, December 14, 2011 9:38:17 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/14/2011(UTC)
Posts: 6
Location: Canada

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Hi there,

I'm working with my team on a fairly large web project, with thousands of tests, and we are trying out NCrunch to see if it can help us as we are working in TDD. The tool looks very promising and we are excited with what we have seen yet.

Sadly, some assemblies aren't covered as NCrunch fails to build them. Some others have question marks on them.

Here is an error we are getting, which seems to be the root problem:

Any idea? Thanks you!

System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
at System.IO.Path.SafeSetStackPointerValue(Char* buffer, Int32 index, Char value)
at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck)
at System.IO.Path.NormalizePath(String path, Boolean fullCheck)
at System.IO.Path.GetFullPathInternal(String path)
at System.IO.Path.GetFullPath(String path)
at nCrunch.Core.ComponentLoader.SnapshotComponentFactory.#=qqd2JX6h79gzNyuwEGEi_zv_71GiUVNyNTQI2Ii0izVw=(String #=qje9ub4E0cNgQGa3PH0irpw==)
at nCrunch.Core.ComponentLoader.SnapshotComponentFactory.#=qhzH3fDgeMQNy$Q7f19YshrzzdhorlM05yRGA_P$fQ6c=()
at nCrunch.Core.ComponentLoader.SnapshotComponentFactory.CreateSnapshotComponentFromXml(String projectFilePath, String projectXml, String solutionFilePath)

I tried setting the WorkspaceBasePath property in configuration, but it didn't solve the problem. We have a lot of subfolders to structure our projects, so the paths are, as a matter of fact, probably long, but I can't change that. Is there someway to solve this, or is it simply a bug?

Jay
Remco
#2 Posted : Wednesday, December 14, 2011 11:56:30 PM(UTC)
Rank: NCrunch Developer

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

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

Thanks for posting! This exception is being thrown from the project loader in NCrunch - so while changing the WorkspaceBasePath is definitely a good idea (and should be done for a project like this), know that this issue will occur before NCrunch goes to construct workspaces.

You can probably solve this issue by moving your project directory further up in the file structure. The issue is likely caused by at least one file within your solution that has an exceptionally long name - watch out for generated files such as WCF service references, as the names of these can get out of hand (and many of them are not actually required to be included in your project at all!). There are many tools that have issues with long file paths (such as SVN etc), so I would not be surprised if you experience other non-NCrunch related issues with this.


Cheers,

Remco

mfjerome
#3 Posted : Thursday, December 15, 2011 3:45:30 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/14/2011(UTC)
Posts: 6
Location: Canada

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Thank you for the fast response.

Naming the file in cause in the stacktrace would make it so much easier to find the cause.
Unfortunately we can't change the structure of directories now, since the projects are deployed on dozens of computers. We don't have any other issues with pathnames as of now, so we'll have to live with that for a bit.

Jay
Remco
#4 Posted : Thursday, December 15, 2011 9:10:52 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
I wish I could offer you a fix, but I don't doubt that there will be many areas within NCrunch's engine where such a long path will cause problems. I'll make a note to improve the error message so it's more informative and will also give you the name of the problematic file.

Cheers,

Remco
Remco
#5 Posted : Friday, December 16, 2011 10:11:09 PM(UTC)
Rank: NCrunch Developer

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

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

I've taken a deeper look at this, and it may be fixable. NCrunch 1.35b isn't efficiently using the entire path space of 260 characters - which means your path may be slightly under this limit but NCrunch is pushing it above. I've implemented a fix in 1.36b, and I think it would be good to give this a try when it's released to see if it solves your problem. 1.36b is due for release within the next few days. I'll keep you posted.


Cheers,

Remco
Remco
#6 Posted : Monday, December 19, 2011 8:07:57 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
The fix for the above problem has now been released as part of 1.36b. Please let me know if this solves the problem for you.
1 user thanked Remco for this useful post.
mfjerome on 12/20/2011(UTC)
mfjerome
#8 Posted : Tuesday, December 20, 2011 4:43:16 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/14/2011(UTC)
Posts: 6
Location: Canada

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Ok thank you. I'll get back to you as soon as possible!
mfjerome
#7 Posted : Tuesday, December 20, 2011 6:40:18 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/14/2011(UTC)
Posts: 6
Location: Canada

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Remco;762 wrote:
The fix for the above problem has now been released as part of 1.36b. Please let me know if this solves the problem for you.


Awesome! The new message helped us to dig out a problem in some .vbproj, where a specific reference was registered with an absolute path instead of a relative path. This path was very long due to our heavy hierarchy, and caused the PathTooLongException.

Thanks a lot for this. Quick answer, good communication, quick solution. We will definitely be using NCrunch from now on, and follow its evolution!
1 user thanked mfjerome for this useful post.
Remco on 12/20/2011(UTC)
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.056 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download