When using SPMetal to generate entity classes, these classes are used in LINQ to SharePoint queries.

We have a project with content type and list definitions and one project with business logic which use the generated entity classes. But in an automated build approch what is the best way to make sure that we always have updated entity classes after a change in a content type and list instance?

I am thinking of making a "Post-build event" command in the Content Type and List definition project.

1 Answer 1


Use a pre-build event (not post-build!) as described in: http://msdn.microsoft.com/en-us/library/ee538587.aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.