创建部署到选定 Web 应用程序但将程序集复制到 GAC 的解决方案 [英] Creating a solution that deploys to selected WebApplications but copies the assembly to GAC

查看:46
本文介绍了创建部署到选定 Web 应用程序但将程序集复制到 GAC 的解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 VisualStudio 2010 创建 SharePoint2010 解决方案,我想将我的解决方案部署到选定的 Web 应用程序(不是全部).我可以通过将程序集部署目标(项目属性)切换到 WebApplication 来做到这一点.但是,该程序集将不会部署到 GAC.

Using VisualStudio 2010 to create a SharePoint2010 solution, I want to deploy my solution to selected WebApplications (not to all). I can do this, by switching Assembly Deployment Target (Project Property) to WebApplication. But then, the assembly will not be deployed to the GAC.

是否有允许部署到特定 Web 应用程序但将程序集部署到 GAC 的设置?

Is there a setting which allows deployment to specific WebApplications, but deploys the Assembly to the GAC?

也许这个问题很难理解,所以这里有一个例子:

Maybe the question is hard to understand, so here an example:

在 SharePoint 场中,每位客户都拥有一个 Web 应用程序.由特定客户订购的自定义功能应该只能在客户的 WebApp 上使用.该功能不应出现在其他 WebApp 的 SiteCollection 功能或网站功能中.

On a SharePoint Farm every customer hat one WebApplication. A custom feature, ordered by a specific customer, should only be usable on the WebApp of the customer. The feature should not appear in the SiteCollection features or WebSite features of other WebApps.

但功能范围必须是站点或网站,才能仅在客户门户的部分区域中激活.

But the feature scope has to be Site or Web to be activated only in parts of the customers Portal.

推荐答案

好的,现在我明白了:只要 WSP 包含 SafeControl 元素,SharePoint 就会要求部署 Web 应用程序.所以如果你在VS项目中添加一个虚拟的web part或者直接在VS中的包中添加一个SafeControl元素,WSP不会自动全局部署.

Ok, now I got it: SharePoint will ask for a WebApplication to deploy to as soon as the WSP contains a SafeControl element. So if you add a dummy web part to the VS project or directly add a SafeControl element to the package in VS, the WSP will not be automatically globally deployed.

这篇关于创建部署到选定 Web 应用程序但将程序集复制到 GAC 的解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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