如何使用 WSP 将 Asp.net Web 应用程序部署到 Sharepoint 2010 站点

发布于 2024-09-13 04:43:31 字数 919 浏览 1 评论 0原文

假设我创建了一个自定义 Web 应用程序,其中包含:

  • 几个程序集 DLL:Web 应用程序、业务逻辑、数据服务
  • 多个 aspx 页面和使用它们的 ascx 自定义控件
  • 自定义配置部分
  • 自定义 HTTP 模块

或多或少都是常用的东西。

我想将其部署到某个子文件夹下的特定共享点站点。因此,如果我通过 http://myserver:90/ 访问我的共享点网站(因为我没有使用sites/some_site )我希望我的应用程序可以在 http://myserver:90/webapp 下使用

我可以手动添加虚拟文件夹(不是应用程序,因为我需要访问某些 Sharepoint 站点的数据)到 IIS 中的 sharepoint 站点,并手动编辑站点的 web.config 文件以注册我的 HTTP 模块并添加我的自定义配置部分要么将我的 DLL 放入 GAC 中,要么将它们放入 _app_bin 中(这样我就不会遇到 CAS 问题),但我认为这不是一件好事,因为这个 Web 应用程序可能会部署在不应该的环境中这不可能。

所以我想我可以使用 Visual Studio 2010 构建一个 WSP 并以这种方式部署它。但我没有足够的经验这样做。

我创建了一个新的 sharepoint 2010 项目。有没有办法可以一次添加所有不可执行的应用程序文件(aspx、ascx)?我已经看到了 WSP 包的高级选项卡,我可以在其中将 DLL 添加到 bin 文件夹或 GAC。我不知道我是否还需要添加任何安全控件并注册某些类?

所以我想我在这里需要一些非常详细和解释性的指导。

Suppose I created a custom web application that consists of:

  • several assembly DLLs: web app, business logic, data services
  • multiple aspx pages and ascx custom controls that use them
  • custom configuration section
  • custom HTTP module

More or less the usual stuff.

I would like to deploy it to a particular sharepoint site under a certain subfolder. So if I access my sharepoint site via http://myserver:90/ (because I'm not using sites/some_site) I'd like my application to be available under http://myserver:90/webapp

I could manually add a virtual folder (not application because I would need to access some Sharepoint site's data) to my sharepoint site in IIS and manually edit site's web.config file to register my HTTP module and add my custom configuration section as well either putting my DLLs into GAC or put them in the _app_bin (so I don't have problems with CAS), but I don't think that's a good thing to do, because this web application may get deployed in an environment where this shouldn't/couldn't be possible.

So I figured I could build a WSP using Visual Studio 2010 and deploy it that way. But I don't have enough experience doing that.

I created a new sharepoint 2010 project. Is there a way I could add all non-executable application files (aspx, ascx) at once? I've seen the advanced tab of the WSP package where I can add my DLLs either to bin folder or GAC. I don't know whether I would also have to add any safe control and register certain classes?

So I suppose I need some pretty detailed and explanatory guidance here.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冷弦 2024-09-20 04:43:31

执行此操作的唯一真正方法是使用布局文件夹通过 wsp 部署应用程序。这将允许您存储通常使用 .web 应用程序部署的任何文件。

然而,存在一些问题。您的应用程序的 URL 将为 http://SharePoint/somesite/_layouts/yourapp

这是一个祝福,一个诅咒。您的 URL 可能会很丑陋,但它们可以在每个 SharePoint 网站下运行。如果您的应用程序依赖于 SharePoint 上下文来运行,则该上下文将根据请求的 URL 自动可用。

要在共享点项目下添加布局文件夹,请右键单击该项目并将映射文件夹添加到布局中。我还建议在您的应用程序的布局下添加一个子文件夹,以便您的应用程序文件不会与直接在布局文件夹中的默认文件发生冲突。

对于 http 模块或任何 web.config 修改,您可以使用 spwebconfigmodification 类。

这是一个演练: http://sharepointsolutions.blogspot.com/2006/12/using -spwebconfigmodificat_116736917110571614.html

The only real way to do this would be to use the layouts folder to deploy your application via the wsp. This will let you depot any files that you would normally deploy with a.web application.

There are couple of problems however. The URL for your application will be http://SharePoint/somesite/_layouts/yourapp

This is a blessing and a curse. Your urls will be ugly but they will work under every SharePoint site. If your application depends on SharePoint context to function, that context will automatically be available based on the requesting URL.

To add a layouts folder under your share point project right click on the project and add a mapped folder to layouts. I would also recommend adding a sub folder under layouts for your application so that your application files don't conflict with the default files directly in the layouts folder.

For the http module, or any web.config modifications, you can use the spwebconfigmodification class.

Heres a walkthru: http://sharepointsolutions.blogspot.com/2006/12/using-spwebconfigmodificat_116736917110571614.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文