I came across this error today while trying to provision some lookup columns as part of a SharePoint 2013 App I was creating. It seems in 2013 you can provision lookup columns declaratively in the Elements XML – this is great news! In 2010 you had to do a sort of halfway house with a combination of XML and some C# code to wire the column up.
The XML I was using for the lookup column was -
It seems you will only see this error when a – you haven’t wired up the lookup column declaratively and b – the column is being provisioned as part of a list – either through the use of a Content Type or otherwise.
Of course the first thing I did was to check the logs in the 15 hive, the message that appears in here is rather spurious –
Possible mismatch between the reported error with code = 0×81070504 and message: “There is no Web named “/mytestapp”.” and the returned error with code 0×80070002. 36714239-fd6e-47c8-b7d5-b5577627c58e
This seems to be referring to the appweburl which of course doesn’t exist until the app has been deployed by Visual Studio. Anyhow once I correctly wired up the lookup columns to their relevant lists the error disappeared and my app deployed. The correct XML to declaratively wire-up a lookup column is as follows -
Looks like I’m in for a world of pain with SharePoint 2013 development – these sandbox errors are even worse than the ones in 2010!