Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying custom dll's in SharePoint 2010

I'm new to SharePoint and trying to get my head around this. I have a simple Web Part project. I also have a custom Data layer project that uses the Microsoft Enterprise Library for data access. In the Web Part project, I am adding a reference to the Data layer project's assembly. I specified in the Package of the Web Part project that I want my Data layer's assembly to be deployed. I can verify this works by using standard ADO.NET classes and not the custom MS library. If I deploy to the SharePoint server (which I have 100% access to) using the Enterprise Library, I get the error message:

"Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data"

What steps do I need to take to ensure this project and all future projects on the server can easily gain access to the Enterprise Library for data access?

Thanks!

like image 849
Mike Avatar asked Feb 23 '11 14:02

Mike


1 Answers

You did everything correct until a certain point: Deployment.

When deploying external DLLs, which shall also be put into the GAC or somewhere else, you need to package them with the WSP aswell. This has become very easy with Visual Studio 2010:

  1. Open your Package
  2. Click on "Advanced" (on the bottom)
  3. Add your external DLL and maybe even SafeControls for the web.config
like image 127
Dennis G Avatar answered Oct 20 '22 02:10

Dennis G