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="188.8.131.52"> <!-- 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…