Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

File Connections with long paths



I’m trying to create a file connection with a very long path name - for instance, I have one that that is 267 characters, which is larger than the default .NET path support. In my application we have internally added support for very long paths using the AlphaFS library.

I can create a connection string with this path and call m_si.Connections = si_connection to set the connection without error or exceptions but the file is never created.

Here is a sample of a file connection I am trying to use that fails:

file(filename=“C:\PN\Word AEO 6.3 NAS - Search emails for Google, manually filter for relating to work performed or proposed01234567890123456789012\PNCU627214\20160411163648_14_Google enlists balloon experts from French space agency to bring Project Loon to life feedly_058-261.sil”)

Is this file path simply too long? The folder C:\PN\Word AEO 6.3 NAS - Search emails for Google, manually filter for relating to work performed or proposed01234567890123456789012\PNCU627214\ does exist before I am setting up the smart inspect object.




Hello Sheri,

Thanks for your posting. The SmartInspect library simply uses the .NET file libraries and if they don’t support long path name, then SmartInspect wouldn’t support this either. Do you have the option to use something shorter or store the log files somewhere else (e.g. in the appdata directory)?




That is pretty much what I figured, I was just looking for confirmation.

This scenario is an extreme case with our application and won’t happen often as most of our users are using .NET as well.

What I did find odd is that my SmartInspect instance didn’t throw any errors when being passed that path, and all logging calls just do nothing as the file connection is the only protocol on that instance. In this case it worked out for me, I just had to handle the case where the logging file doesn’t exist.



Hello Sheri,

Thanks for the update! Error handling is done via the SmartInspect.Error event and SmartInspect doesn’t throw any exceptions in order to not change the application behavior.




I would suggest using the Long Path Tool. It worked really well for me!


The file name is too long and when coupled with the path name it becomes larger. Either cut down the file name or move it to some other directory. Or maybe you could use some software for a permanent solution to this. I would suggest you to use GS Richcopy 360. I am also using this software and it has helped me along the way. Maybe it can help you too. Thanks


Try using Long Path Tool program that fixes issues of long path files with simplicity.