应如何管理共享彼此代码的 SharePoint Visual Studio 项目?
我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这似乎是合理的,尽管您可能需要小心共享项目的部署 - 部署脚本可能包括更新公共包,这对于旧的站点特定项目来说并不好。
对于大多数项目,我更喜欢使用包含必要共享库的单一解决方案包 - 通常安装到 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.
如果您还没有这样做,我会考虑将您的通用代码捆绑到一个或多个功能中,并将非通用代码放在与通用代码具有功能依赖性的功能中。 您可能希望公共代码使用不同的 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.