Updating BDC Models in SharePoint 2010

Using Visual Studio 2010, I created a BDC Model and deployed it to a SharePoint 2010 farm. After a while, I made some modifications to that model, retracted the old feature and deployed the modified feature. Unfortunately, my updates to the model did not appear in SharePoint. In the GAC and in the SharePoint root, I did see my newly deployed assembly, though. What’s wrong?

I turns out that SharePoint obviously stores the BDC model in its database and only overwrites it, when a new model with the same name and a different version is deployed. So in order to update my model, I had to open the bdcm file with an XML editor and modify the element that specifies my model entity:

<?xml version="1.0" encoding="utf-8"?>
<Model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/windows/2007/BusinessDataCatalog" Name="MyBDCModels">
  <LobSystems>
    <LobSystem Name="MyModelAssembly" Type="DotNetAssembly">
      <LobSystemInstances>
        <LobSystemInstance Name="MyModelAssembly" />
      </LobSystemInstances>
      <Entities>
        <Entity Name="MyEntity" Namespace="MyModelAssembly.Models.MyBDCModel" Version="1.0.0.0">
          <!-- entity definition here  -->
        </Entity>    
    </LobSystem>
  </LobSystem2>
</Model>

The element contains an attribute called version. Increment the version specified by this attribute and off you go…

Freelance full-stack .NET and JS developer and architect. Located near Cologne, Germany.

1 thought on “Updating BDC Models in SharePoint 2010

  1. Great info! For SP 2013 I found I also had to deactivate the farm feature and re-activate it before model changed appeared.

Leave a Reply

Your email address will not be published. Required fields are marked *