Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" ReceiverClass="Microsoft.Office.SharePoint.ClientExtensions.Deployment.ImportModelReceiver" Scope="Farm" Title="Foobar.SharePoint.BCS BDC Models">
  <Properties>
    <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" />
  </Properties>
  <ElementManifests>
    <ElementFile Location="SmartAppBDCModel\SmartAppBDCModel.bdcm" />
    <ElementFile Location="BdcAssemblies\Foobar.SharePoint.BCS.dll" />
  </ElementManifests>
</Feature>
share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

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.

share|improve this answer
add comment

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

http://blog.techperspect.com/2013/12/how-to-update-bdc-bcs-custom-connector.html

share|improve this answer
add comment

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.

share|improve this answer
    
Please add some context on what makes this an answer, instead of just linking out of our site (links are short lived). –  Anders Rask Oct 31 '11 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 '11 at 10:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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