I have created a BDC model and deploy it through a feature. The feature has to have a SiteUrl as specified in the feature xml below. However when I move the feature from say the development to test, acceptance or production environment, then the SiteUrl will cause a conflict and the WSP package will fail to install.

Now this is not very handy since I have to either repackage every time I move environment or fiddle with URLs / Alternate Access Mappings in the environments. My question is are there any handy approaches to this problem? So far the only approach I could think of is a custom build script. Surely there must be something handier...

<Feature xmlns="http://schemas.microsoft.com/sharepoint/" Description="This feature installs the BDC Models for the Business Connectivity Service" Id="83af2a77-02f5-4391-8bf5-917addc8029d" ReceiverAssembly="Microsoft.Office.SharePoint.ClientExtensions, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" ReceiverClass="Microsoft.Office.SharePoint.ClientExtensions.Deployment.ImportModelReceiver" Scope="Farm" Title="Foobar.SharePoint.BCS BDC Models">
    <Property Key="SiteUrl" Value="http://sparked-dev:9999" />
    <Property Key="IncrementalUpdate" Value="true" />
    <Property Key="ModelFileName" Value="SmartAppBDCModel\SmartAppBDCModel.bdcm" />
    <Property Key="SmartAppBDCModel" Value="BdcAssemblies\Foobar.SharePoint.BCS.dll" />
    <ElementFile Location="SmartAppBDCModel\SmartAppBDCModel.bdcm" />
    <ElementFile Location="BdcAssemblies\Foobar.SharePoint.BCS.dll" />

3 Answers 3


Apparently this is a bug. A possible solution is to use http://localhost/ as the URL, but I think this may still get overwritten by VS when you next open the project. In that case a custom build action may be the way to go for the time being.


I also stubled over that problem and found the answer in this post: http://www.silver-it.com/node/92.

It mainly proposes the following:

  • Remove the association to the event receiver from the model (property "Feature Reeiver" of the BDC project)
  • Edit the existing feature that deploys the BDC Model, Add an event receiver to it
  • Create a new class that derives from ImportModelReceiver (lets call it CustomBdcDeployment)
  • In FeatureActivated of your feature set the property (of the instance of SPFeatureReceiverProperties you get passed in the method FeatureActivated) SiteUrl to the value you need (get it from wherever you want). Create an instance of your custom class craeted above (CustomBdcDeployment) and pass the modified instance of SPFeatureReceiverProperties to its FeatureActivated method.
  • In the FeatureDeactivating do pretty much the same as on FeatureActivated. Set the property SiteUrl to the value you need and pass the properties to FeatureDeactivating of a new instance of CustomBdcDeployment.

that's it.

  • Please add some context on what makes this an answer, instead of just linking out of our site (links are short lived). Oct 31, 2011 at 11:39
  • @AndersRask. Ok. I summarized the proposal. I just didn't want to steal the answer. But i understand your objection
    – tschuege
    Nov 1, 2011 at 10:45

If you are looking for updating BDC connector DLL programatically through code then please check this link : -


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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