SP2010: Assembly was requested for LobSystem with Name, but this assembly was not returned

Working my way through BCS, I encountered another error which seems to be pretty undocumented. It’s as follows:


Error while executing web part: System.InvalidOperationException: Unable to open the specified list item. ---> Microsoft.BusinessData.Infrastructure.BdcException: The shim execution failed unexpectedly - Assembly was requested for LobSystem with Name 'Company.Projects.Contoso.BCSLobSystem', but this assembly was not returned. SystemUtility of Type 'Microsoft.SharePoint.BusinessData.SystemSpecific.DotNetAssembly.DotNetAssemblySystemUtility' requires the assembly to be uploaded.. ---> System.InvalidOperationException: Assembly was requested for LobSystem with Name 'Company.Projects.Contoso.BCSLobSystem', but this assembly was not returned. SystemUtility of Type 'Microsoft.SharePoint.BusinessData.SystemSpecific.DotNetAssembly.DotNetAssemblySystemUtility' requires the assembly to be uploaded.

When you read my previous blog posts, you know I’m working in a multi tenant environment, which is linked to a non-partitioned BCS service application. I don’t know for sure if that has something to do with this, but I’m guessing it does.

I also wished I could explain to you what’s going wrong here, but truthfully I really can’t. What I can do though, is provide you with the solution I found after some struggling with BCS and Powershell. Because the error stated the assembly needs to be uploaded, I came accross the Import-SPBusinessDataCatalogDotNetAssembly function. That proved to be the solution to my problem. Use it like this:


$url = "http://www.contoso.com"
$assemblyPath = "C:\lobsystem.dll"
$lobSystem = "Company.Projects.Contoso.BCSLobSystem"

Write-Host "Adding assembly to LOBSystem"
$serviceContext = Get-SPServiceContext $url
$lobSystem = Get-SPBusinessDataCatalogMetadataObject -ServiceContext $serviceContext -BdcObjectType lobsystem -Name $lobSystem
Import-SPBusinessDataCatalogDotNetAssembly -LobSystem $lobSystem -Path $assemblyPath

After executing this, everything started working!

Leave a Reply

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