Business Connectivity Services (BCS), one of the key components of SharePoint 2010, helps you to access external line-of-business (LOB) data. The SharePoint team posted a blog entry which demonstrates how to create your first BDC (Business Data Connectivity) model using Visual Studio 2010. As indicated in the post, you can use Visual Studio 2010 to deploy your BDC model to Microsoft SharePoint Server 2010.
However, if you are using Microsoft SharePoint Foundation 2010 on your develop machine, or you want to make the model deployable to Microsoft SharePoint Foundation 2010 on other machines, you will need to write a Feature Event Receiver to enable the deployment of BDC models from within Visual Studio 2010. In this blog post, I’ll show you how to create a Feature Event Receiver to do so.
Here are the detailed steps:
C# Project - - Assembly = $SharePoint.Project.AssemblyFullName$ - Class Name = BDCModelReceiver.Features.Feature1.ImportModelReceiver
VB Project – - Assembly = $SharePoint.Project.AssemblyFullName$ - *Class Name = BdcModelProject1.BDCModelReceiver.Features.Feature1.ImportModelReceiver * Replace “BdcModelProject1” with your own project name
VB Project - - *Receiver Class = BdcModelProject1.BDCModelReceiver.Features.Feature1.ImportModelReceiver * Replace “BdcModelProject1” with your own project name
For more information about Business Connectivity Services, please also check out BCS Team blog.
I've got the same error as Tiklu Ganguly
Error 3 Error occurred in deployment step 'Add Solution': Failed to load receiver assembly "BCSFileConnector, Version=22.214.171.124, Culture=neutral, PublicKeyToken=584c9b9842ffd739" for feature "BCSFileConnector_Feature1" (ID: c5a860c0-78d5-4a90-a237-d8a9143c890d).: System.IO.FileNotFoundException: Could not load file or assembly 'BCSFileConnector, Version=126.96.36.199, Culture=neutral, PublicKeyToken=584c9b9842ffd739' or one of its dependencies. The system cannot find the file specified.
File name: 'BCSFileConnector, Version=188.8.131.52, Culture=neutral, PublicKeyToken=584c9b9842ffd739'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
If you need to move the feature to several environments you can get the URL for the Web Application by using SPWebService:
SPWebService webService = properties.Feature.Parent as SPWebService;
SPWebApplication webApp = webService.WebApplications["SharePoint 80"];
properties.Definition.Properties["SiteUrl"].Value = site.Url;
i m getting this error i follow all instruction but getting error
Error 1 The Feature "Feature1" has conflicting event receiver settings from the following items: BdcModel1, Feature1. D:\BdcModelProject1\Features\Feature1\Feature1.feature BdcModelProject1
Hi Rong Lu,
Really a great time saver and is there any other work around. Really appreciate for your effort and time...
Excellent article...Thank you so much buddy...
God bless you :)
Hi Rong Lu,I followed all the steps you mentioned in your blog and deployed the solution. My deployment was successful. But I am not able to see this in the metadata store. Can you please help? Thanks in advance.
The link does not work. CAn anyone leave the Feature1EventReceiver.cs again?