在 SharePoint 2010 中部署自定义 dll [英] Deploying custom dll's in SharePoint 2010

查看:52
本文介绍了在 SharePoint 2010 中部署自定义 dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 SharePoint 的新手,正在尝试解决这个问题.我有一个简单的 Web 部件项目.我还有一个使用 Microsoft Enterprise Library 进行数据访问的自定义数据层项目.在 Web 部件项目中,我添加了对数据层项目程序集的引用.我在 Web 部件项目的包中指定我希望部署数据层的程序集.我可以通过使用标准 ADO.NET 类而不是自定义 MS 库来验证这是否有效.如果我使用企业库部署到 SharePoint 服务器(我有 100% 的访问权限),我会收到错误消息:

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:

无法加载文件或程序集Microsoft.Practices.EnterpriseLibrary.Data"

"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?

谢谢!

推荐答案

在某个点之前,您所做的一切都是正确的:部署.

You did everything correct until a certain point: Deployment.

在部署外部 DLL 时(也应放入 GAC 或其他地方),您还需要将它们与 WSP 一起打包.这在 Visual Studio 2010 中变得非常容易:

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. 打开您的包裹
  2. 点击高级"(底部)
  3. web.config
  4. 添加您的外部DLL,甚至SafeControls

这篇关于在 SharePoint 2010 中部署自定义 dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆