{"id":525,"date":"2012-04-04T13:52:18","date_gmt":"2012-04-04T12:52:18","guid":{"rendered":"http:\/\/blog.repsaj.nl\/?p=525"},"modified":"2012-04-04T13:53:31","modified_gmt":"2012-04-04T12:53:31","slug":"sp2010-assembly-was-requested-for-lobsystem-with-name-but-this-assembly-was-not-returned","status":"publish","type":"post","link":"http:\/\/blog.repsaj.nl\/index.php\/2012\/04\/sp2010-assembly-was-requested-for-lobsystem-with-name-but-this-assembly-was-not-returned\/","title":{"rendered":"SP2010: Assembly was requested for LobSystem with Name, but this assembly was not returned"},"content":{"rendered":"<p>Working my way through BCS, I encountered another error which seems to be pretty undocumented. It&#8217;s as follows:<\/p>\n<p><code><br \/>\nError 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.<\/code><\/p>\n<p>When you read my previous blog posts, you know I&#8217;m working in a multi tenant environment, which is linked to a non-partitioned BCS service application. I don&#8217;t know for sure if that has something to do with this, but I&#8217;m guessing it does. <\/p>\n<p>I also wished I could explain to you what&#8217;s going wrong here, but truthfully I really can&#8217;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:<\/p>\n<p><code><br \/>\n$url = \"http:\/\/www.contoso.com\"<br \/>\n$assemblyPath = \"C:\\lobsystem.dll\"<br \/>\n$lobSystem = \"Company.Projects.Contoso.BCSLobSystem\"<\/p>\n<p>Write-Host \"Adding assembly to LOBSystem\"<br \/>\n$serviceContext = Get-SPServiceContext $url<br \/>\n$lobSystem = Get-SPBusinessDataCatalogMetadataObject -ServiceContext $serviceContext -BdcObjectType lobsystem -Name $lobSystem<br \/>\nImport-SPBusinessDataCatalogDotNetAssembly -LobSystem $lobSystem -Path $assemblyPath<br \/>\n<\/code><\/p>\n<p>After executing this, everything started working!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Working my way through BCS, I encountered another error which seems to be pretty undocumented. It&#8217;s as follows: Error while executing web part: System.InvalidOperationException: Unable to open the specified list item. &#8212;> Microsoft.BusinessData.Infrastructure.BdcException: The shim execution failed unexpectedly &#8211; Assembly was requested for LobSystem with Name &#8216;Company.Projects.Contoso.BCSLobSystem&#8217;, but this assembly was not returned. SystemUtility of<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[34],"tags":[11,7],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3KFR1-8t","_links":{"self":[{"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/posts\/525"}],"collection":[{"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/comments?post=525"}],"version-history":[{"count":0,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/posts\/525\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/media?parent=525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/categories?post=525"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/tags?post=525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}