Well after some search SPMarcel (short for SharePoint Marcelleke) has found a solution to a problem that we had.
History
I’m currently working with a client that needed a parser that parsed all kinds of different files and retrieve the information accordingly. While defining the site structure with a colleague is where the problems began.
They need a lookup in the same site BUT also needing a lookup to the parentsite.
Needless to say that this is quite hard to realize. When building an STP the lookup is to the document library of the site where you pulled the STP from. Also building the solution via Code or CAML didn’t prove a solution so we had to make decisions cancelling a few lookups.
So on we went building the site. We used Solution Generator which proved to be a great tool.
We are now at the point that we create a blank site via code BUT after that activating a feature so that all the lists/document libraries with the list content types and columns is generated.
Here is where it goes wrong.
In my parser I automatically upload all the files to the correct document library.
And suddenly my parser uploaded one file and crashes after that (not when uploading my file but adding the metadata), where in the old (read: created via GUI) solution it could parse 3000 files.
The Error
So after some debugging the error was found:
“The URL ‘FileName’ is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web”
Well good luck hunting! 😄
After a while of making Google our best friend we found a blog also describing the same error but with a twist. In that blog they were doing a migration from SPS 2003 to MOSS 2007 — not quite the same but the world isn’t perfect.
The key phrase in the blog however is: “The problem is with SharePoint Solution Generator.”
This is interesting, no? The SharePoint world says that this is one of the best tools out there, but it seems that this has a big flaw in my eyes.
The Cause
It seems that the solution generator automatically assigns colname="nvarchar" and colname="ntext" fields (where n is an incremental number) to the schema.xml. Why this is, I don’t have a clue — if somebody can explain why it’s added but when removed you don’t see a difference, I’d love to know.
The Fix
After removing all the fields with colname="nvarchar" and colname="ntext" in the Fields tag, rebuilding the WSP and installing it — everything works fine.
So many thanks to jerry for pointing this one out!