WSPBuilder:如何创建部署包来部署.dll和.wsp?
我正在使用 WSPBuilder,它非常有帮助。然而,由于缺少手册,很难理解 WSPBuilder 的强大之处。我必须创建一个解决方案文件来部署“SmartPart 返回”(.wsp 文件)、“应用程序模板核心”(.wsp 文件)以及“AJAX 扩展”(.dll 文件)。因此,我不必编辑 web.config 来将它们标记为安全控件。请建议如何?
I'm using WSPBuilder and it is being very helpful. However, it was being hard to understand the strength of WSPBuilder because of missing manual. I've to create a solution file to deploy "Return of SmartPart" (.wsp file), "Application Template Core" (.wsp file) and also "AJAX Extensions" (.dll files). So, I won't have to edit the web.config to mark them safe controls. Please, suggest HOW?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
快速回答:
C:\Program Files\WSPBuilder\WSPBuilder.exe.config
(或者您安装它的位置)
添加 key="BuildSafeControls" value=""
长答案:
当您想要通过 Visual Studio 快速部署到 SharePoint 安装时,WSPBuilder 非常有用。我发现,当您需要部署 CAS 策略时,配置会变得更加困难,但我确信它们会在未来的版本中在该领域发挥作用。
您的场景中的 WSPBuilder 可以自动构建和部署需要进入您的站点的安全控制条目。 WSP 的好处是,一旦您撤回解决方案,它也会返回并删除安全控制条目,因此您无需进行清理工作。
对于不同的项目,如果您需要安装第三方wsps,那么WSPBuilder还没有为此目的而设计,我建议使用一些stsadm命令的简单批处理文件。如果其中一些解决方案是您自己的代码,您应该将每个解决方案分为不同的 VS 项目并单独构建它们的 WSP。您甚至可能需要将它们分成不同的 .sln (解决方案文件),但我自己没有尝试过这种方式,所以不能肯定地说。
就我个人而言,如果我可以确定它不会添加可能成为问题的额外位,我只会使用 WspBuilder 来构建需要部署到实时环境的部署包。因此,您需要考虑 WSPBuilder wsp 是否足够适合您。
最近,我遇到了 CAS 策略的问题,并决定手动制作我的 WSP。在本质上,WSP 文件是 CAB 文件,您只需创建一个 CAB 文件并将其扩展名重命名为 .WSP。我建议创建一个 WSP,将其重命名为 mysolution.cab。打开它并解压文件,看看它是否按照您的要求进行操作。要查看的关键文件:manifest.xml。
Quick answer:
C:\Program Files\WSPBuilder\WSPBuilder.exe.config
(or where ever you've installed it)
add key="BuildSafeControls" value=""
Long answer:
WSPBuilder is great for when you want to do a quick deployment via Visual Studio to your SharePoint installation. I have found that that it gets harder to configure when you need to deploy CAS policies but I'm sure they will do work in this area for future versions.
WSPBuilder in your scenario can automatically build and deploy the safecontrol entries that need to go into your site. Good thing about WSP's are that once you retract a solution, it will also go back and remove the safecontrol entries so you don't need a tidy up job.
Regarding different projects, if you need to install third party wsps, then WSPBuilder hasn't been designed for that purpose, I suggest a simple batch file with some stsadm commands. If some of these solutions are your own code, you should divide each into a different VS project and build their WSP's seperately. You may even need to divide them into different .sln (solution files) but I've not tried this way myself so couldn't say for sure.
Personally, I would only use use WspBuilder to build deployment packages that need to be deployed to live environments if I can be sure its not adding extra bits that may become a problem. Therefore you'll need to think about WSPBuilder wsp's are good enough for you.
Recently I came accross an issue with CAS policies and decided to make my WSP's manually. Under the hood, WSP files are CAB files, you can just create a CAB file and rename its extention to .WSP. I would advise, creating a WSP, rename it to mysolution.cab. Open it and up and extract the files, and have a look to see whether its doing what you want. Key file to look at: manifest.xml.
据我所知,您不能将 WSP 文件嵌套在其他 WSP 文件中。您必须单独安装它们。
如果您想要安装 DLL(除了作为 WSPBuilder 项目一部分构建的 DLL 之外),请在项目中创建一个名为 GAC 的文件夹并将它们放在那里。安装 WSP 时,该文件夹中的所有 DLL 都将安装到 GAC。
要安装 WSP 包,您需要运行:
然后您可以从 SP 管理中心部署它。
As far as I know, you can't nest WSP files in other WSP files. You'll have to install those separately.
If you want to install DLLs (other than the one that's built as part of your WSPBuilder project), create a folder in the project called GAC and put them there. All DLLs in that folder will be installed to the GAC when the WSP is installed.
To install a WSP package, you'll need to run:
You can then deploy it from SP Central Administration.
您还可以在不使用 WSPBuilder 的情况下手动创建 WSP 文件 - 它是一个 CAB 存档,并且您可以使用 Windows 附带的 makecab.exe 实用程序以及列出应在 WSP 文件中结束的文件的附加描述文件来创建 WSP 文件。
You can also create a WSP file manually without WSPBuilder - it's a CAB archive and you can create a WSP file using the makecab.exe utility that comes with Windows and an additional description file that lists the files that should end up in the WSP file.