Posts Tagged ‘list definition’

SharePoint 2010: The filename, directory name, or volume label syntax is incorrect

Monday, November 7th, 2011

This is a peculiar little bug. When creating a List Definition, you may encounter the following error when you try to deploy:

The filename, directory name or volume label syntax is incorrect.

It took a while to track the cause, seeing as a lot of info out there info out there relates to things to do with file systems, which in this case, obviously wasn’t the cause.

The bug for me was that I had created a List Definition and called it My.List.Definition – notice the multiple periods. I wanted it to match the namespaces that we were using. It turns out that the second period trips it up. When you create a List Definition with multiple periods, the List Definition only gets the first period, e.g., My.List, whereas the Elements.xml file for the List Definition still references My.List.Definition – hence it can’t deploy properly.

To fix, edit the Elements.xml file to match the List Definition name. However, I’ve experienced knock-on issues as a result of this, for example, instances of the List Definition fail to deploy. It seems more reliable to completely delete the List Definition and recreate it with at most one period in the name.

SharePoint 2010 + Kofax Express + Object reference not set to an instance of an object

Friday, July 1st, 2011

I’ve been working with Kofax Express 2.0 recently to move documents from a scanner directly in to a SharePoint document library. I was using a custom list definition (created in Visual Studio) but was experiencing a strange error. If I created an instance of my list through the UI and then tried to scan from Kofax directly in to SharePoint, it was working no problem. However, if I tried to scan directly to SharePoint to the instance of the list created by the Visual Studio solution, I was getting the common error – “Object reference not set to an instance of an object”. There were no helpful logs on the Kofax or SharePoint end, and it was only through trial and error that I found the issue. I noticed that when the list was created through the UI, it was created with a URL of “/Document Library Name” whereas in my list instance definition in Visual Studio, I had given it a URL of “/Lists/Document Library Name”. It was the Lists part at the beginning which was causing an error. I don’t know why this caused Kofax to fail to find the library, but nevertheless, setting the URL in the list instance as just “/Document Library Name”, resolved the issue.