Wednesday, 7 September 2011

Specifying a namespace in SPMetal generated entities files

Today I generated two entities.cs files using SPMetal without specifying namespaces, and was met with a whole host of ambiguity errors, such as
Ambiguity between 'Item._entityState' and 'Item._entityState'
Deleting my files and re-running SPMetal, this time specifying different namespaces for each file, resolved the problem:
SPMetal /web:http://mysite/myweb /code:C:\Projects\MyProject\MyEntities.cs /namespace:MyExampleNamespace

No comments:

Post a Comment

Comments are moderated, so you'll have to wait a little bit before they appear!