The task: connect Outlook with the external list, which was created in Visual Studio and uses SAP connector (sapnco.dll).
What I've done:
- Created this external list. I can see all information in SP.
- Chose its Office Item Type as Appointment.
- Pressed the Connect to Outlook button, it installed automatically generated VSTO and appared in the Outlook. But I can't see any items there.
- When I am pressing the Synchronization status button in Outlook, I can see the error in loading Assembly "sapnco, Version=220.127.116.11, Culture=neutral, PublicKeyToken=50436dca5c7f7d23"
- Is it possible to add a dll to vsto? Or maybe I can workaround it in some way?
- Where can I find additional information about my issue (and what is happening behind the scenes when Outlook uses SP external list)?
Every suggestions are very appreciated.
"An error occurred while importing the BDC Model. Details: ".", hexadecimal value 0x00 is an invalid character. Line 2. Position 1." in the BCS Artifact Generator.
PPS: I know one workaround. I can create webservice for fetching data from SAP, and use it (I think I could use it without additional dlls). But maybe somebody could propose more suitable approach?
UPDATE1: Full error message in original language (German):
"Unerwarteter Fehler der "MethodInstance" mit dem Namen "ReadListInstance" für die Entität (externer Inhaltstyp) mit dem Namen "AbsenceCalendar" im Namespace "SapDataProvider.SapAbsencesModel1". Fehler in Methode "ReadList", die in Klasse "SapDataProvider.SapAbsencesModel1.AbsenceCalendarService" mit der Nachricht "Die Datei oder Assembly "sapnco, Version=18.104.22.168, Culture=neutral, PublicKeyToken=50436dca5c7f7d23" oder eine Abhängigkeit davon wurde nicht gefunden. An attempt was made to load a program with an incorrect format." definiert ist."
Translation of the error message:
"Unexpected failure of "MethodInstance" named "ReadListInstance" for the entity (external content type) with the name "AbsenceCalendar" in namespace "SapDataProvider.SapAbsencesModel1". Error in method "Read List" in the class = "SapDataProvider.SapAbsencesModel1.AbsenceCalendarService" with the message "The file or assembly 'sapnco, Version = 22.214.171.124, Culture = neutral, PublicKeyToken 50436dca5c7f7d23" or one of its dependencies was not found. An attempt was made to load a program with an incorrect format. "defined."
UPDATE2: Thanks for almostSharepointMaster for his continuing investigation. He suggests that it is because of incorrect dll format, (maybe 32bit and 64bit). Unfortunately for the moment I can't prove or reject this statement.
Both systems (SP server and client with Outlook work on 64 bit platform).
My code (which uses sapnco) is built using Platform target: Any CPU. I don't know about format of sapnco dll, but it works well on server and because server is 64 bit too I think it should work on the 64 bit client too.
Sapnco dll file size is more than 4 MB
But I can't see so huge files in the ClientSolution directory of SP site. If I understand correctly, to allow Outlook to work with external list it installs vsto package from this folder. Maybe I should check some information in the xml files, but I can't see any references to dll there and don't know what too look for.
Also I've tried to enable 32 bit applications on SharePoint pool as on proposed by almostSharepointMaster link, but after it SP failed to start. Now I've reverted it back.
UPDATE3: I've realized why it show error about incorrect dll format instead of "can't find the file" (which I saw the first time). It was because I tried to add this dll manually to Windows\System32 dir. When I delete it from there I get the next error:
When I place it to the system32 dir of the machine with Outlook (not SP server) and restart the computer it back to incorrect format again.
I think it means that Outlook shows message about error in loading dll on client side (not error, which is in the SP server). And my thought that the cause of the issue is missed dll in vsto is correct.
Could anybody help me in my investigation?