SPML suddenly unfunctional

Dec 17, 2007 at 3:07 PM
I was using the SPML wizard in VS 2008 and it was working great. Suddenly when I create new SPML items, they have no associated code behind file like the first SPML file did. When I select "Run custom tool" from the SPML context menu in Solution Explorer, I get the error "The custom tool 'LinqtoSharePointGenerator' failed". I have done the repair option in the installation tool, rebooted, etc. to no avail.
Dec 18, 2007 at 1:14 AM
This is very strange behavior indeed. Can you check whether spmetal.exe (in the installation folder) experiences the same issue when you pass it the SPML file? Essentially the back-end for both the VS-integrated code generator and the spmetal tool is the same but VS catches all exceptions masking these as "The custom tool xyz failed." while spmetal should bail out with a more specific exception.

Dec 18, 2007 at 3:24 PM
OK I tried what you suggested. To clarify something first though; I only get that error message when I go through the context menu "run custom tool". When I run through the SPML wizard, no error is thrown, it just doesn't create any code behind file. Now when I try what you mentioned I get:

"Invalid Lookup field list reference encountered: list {79d9e61d-e6ec-405d-8e63-62a17f801a7f} referred to by field ListServs is unknown in the SharePoint context."

I can tell you that this particular list does have a look up field in it. I fell back to using SPMetal yesterday after Visual Studio was unable to help me, and low and behold, it did appear to create the lookup fields. In this case it was:

private global::BdsSoft.SharePoint.Linq.EntitySet<ListServs> _ListServs
Apr 4, 2008 at 1:04 PM

I have the same problem.
The error I'm getting is:

Invalid Lookup field list reference encountered: list Docs referred to by field
_CheckinComment is unknown in the SharePoint context.

Mar 16, 2009 at 5:56 PM
Hi there,

I was having the same issue... Based on what apauluhn was getting...it looks like this solution does not like the lookup / referenced columns...
Jun 22, 2009 at 7:30 PM

From looking at the code, it looks like the referenced list needs to be in the same SP context - i.e. in the same SPML file.


I added all my lists under the <Lists> element in the SPML file and this seemed to fix this problem.