Saturday, February 18, 2012

Communication object, System.ServiceModel.InstanceContext, cannot be used for communication

Share/Save/Bookmark

Error occurred in deployment step 'Recycle IIS Application Pool': The communication object, System.ServiceModel.InstanceContext, cannot be used for communication because it has been Aborted

Before banging your head try restarting the Visual Studio. if still no luck then you can go back banging yourself ;)

  Subscribe

the-object-has-been-updated-by-another-user-since-it-was-last-fetched/

Share/Save/Bookmark


the-object-has-been-updated-by-another-user-since-it-was-last-fetched/

You may be victim of this error when trying to update the content types with a code similar as below ,

SPContentType ct = web.ContentTypes[contentType];
ct.FieldLinks.Add(new SPFieldLink(field));
ct.Update(true);
web.Update();

To get rid of this error, get the new instance of the SPWeb object instead of using the one from SPContext.Current.Web or from feature properties.
If it still did not work then perhaps you may be updating content types in an enumeration for which you should try using new web object for each content type update.



 Subscribe