Showing results for 
Search instead for 
Did you mean: 

How to deploy NCo 3.0 DDL for SharePoint?

Former Member
0 Kudos

I'm using NCo 3.0 to connect to SAP from user control within SharePoint page? For doing this, DDLs of connector should be deployed either to GAC or Bin folder.

Either using Bin folder or GAC, I got the following exception "Could not load file or assembly 'sapnco' or one of its dependencies."

Any ideas why I getting this exception? Or anyone know about the proper way to deploy NC0 3.0 for SharePoint?

View Entire Topic
0 Kudos

Synopsis: Check the version of the NCo 3 that you are using and compare it to your development environment, your server/IIS version, and potentially the target .NET Framework of the Application Pool that the SharePoint website is running in.

I'm just beginning to figure this one out as well. I am running Windows 7 64-bit with Visual Studio 2010 and using the NCo 64-bit that was compiled using the .NET Framework 4. The full error that I was getting was "Could not load file or assembly 'sapnco' or one of its dependencies. An attempt was made to load a program with an incorrect format." The confusing part for me was that it was working just fine in a standard Windows Forms application. I was only getting those errors in Web Site projects or Web Application projects.

I found the following blog about [Running IIS 32-bit Applications on IIS 64-bit|] that got me thinking. My OS is Windows 7 64-bit, but Visual Studio 2010 only comes in a 32-bit version. In order to build the Web Site project, I needed to add references (basically copy the .dll files to the Bin folder) for the NCo 3 .Net 4 32-bit DLLs. This allowed the project to compile and run in the development web server (WebDev.WebServer40.exe) which was also running in 32-bit mode. When I published the site to the local IIS instance, however, it broke again because the full-blown IIS was running in 64-bit mode and needed the 64-bit DLLs. Overwriting the 32-bit deployed DLLs with the 64-bit DLLs enabled the published website to work as well.

Although it isn't SharePoint-specific, I hope this helps!