应如何管理共享彼此代码的 SharePoint Visual Studio 项目?

发布于 2024-07-20 04:28:40 字数 432 浏览 8 评论 0原文

我的 SharePoint Visual Studio 解决方案结构当前包含以下项目:

  • Common: 包含扩展方法、帮助器、常用控件等。
  • Logging: 通常包含在 Common 中,但包含调用标记为“不安全”的本机方法
  • 特定于站点的项目:针对每个不同的站点,包含特定于该站点的功能、Web 部件、事件接收器等
  • 控制台应用程序: > 根据需要/如果需要控制台应用程序项目

我正在使用 WSPBuilder,因此每个项目(除了控制台应用程序)都有自己的 SharePoint WSP 解决方案文件。

这是拆分 SharePoint 代码的好方法吗? 您使用什么方法?

My SharePoint Visual Studio solution structure currently contains these projects:

  • Common: contains extension methods, helpers, frequently used controls, etc.
  • Logging: would normally be included in Common but contains calls to native methods so marked 'unsafe'
  • Site-specific project: one for each distinct site, containing features, web parts, event receivers, etc. specific to that site
  • Console app: console app projects as/if needed

I'm using WSPBuilder hence each project (apart from the console apps) has its own SharePoint WSP solution file.

Is this a good way to split up SharePoint code? What approaches do you use?

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

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

发布评论

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

评论(2

酒中人 2024-07-27 04:28:40

这似乎是合理的,尽管您可能需要小心共享项目的部署 - 部署脚本可能包括更新公共包,这对于旧的站点特定项目来说并不好。

对于大多数项目,我更喜欢使用包含必要共享库的单一解决方案包 - 通常安装到 GAC。

That seems reasonable, though you might want to be careful about the deployment of the shared projects - The deployment script probably includes updating the common package, which isn't good for older site specific projects.

For most projects I prefer to have a single solution package with necessary shared libraries included - usually being installed to the GAC.

公布 2024-07-27 04:28:40

如果您还没有这样做,我会考虑将您的通用代码捆绑到一个或多个功能中,并将非通用代码放在与通用代码具有功能依赖性的功能中。 您可能希望公共代码使用不同的 WSP 或相同的 WSP - 不确定其所有优点/缺点。

If you aren't doing this already, I would consider bundling your common code into one or more features and have the non-common code be in a feature with a feature dependency to the common code. You may want to have the common code use a different WSP or the same WSP - not sure of all of the pros/cons of that.

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